class jieshouxianche extends Thread{
public void run(){
while(true){
try {
sc=(SocketConnection)Connector.open("socket://192.168.0.100:9998");
dos = sc.openDataOutputStream();
dos.writeUTF(tf.getString());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
DataInputStream dis = sc.openDataInputStream();
String info=dis.readUTF();
f.append(info+"\n");
//如果客户端没有发东西过来 主程序会一直死等,所以用到线程
// System.out.println(string);
} catch (IOException e) {
e.printStackTrace();
}
} close();
}
private void close() {
try {
sc.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
-----------close()显示 错误remove
如何关闭 soketconnect 呢??????????