i hava a program connect to server through xot (x25 over tcp/ip) protocol.
i have a thread to connect, send recv data with server using xot library.
public class MyThread extends Thread{
public MyThread() {
}
@Override
public void run(){
// init sock
...
// connect to server
sock.connect("server_address", timeout);
System.out.println("send data ..");
sock.send(data);
System.out.println("send data ok, recv data ..");
Data data = sock.recv();
System.out.println("recv data ok");
}
}
My lib i use can handle connect timeout, but there is no method like setSoTimeout() to handle timeout when send & recv data.
So, i dont know how to stop mythread right-way when send & recv method run for a long time.
anyone could suggest me some solution.
thanks
Quan