> >> but is it other way to stop it?
> >> I mean long time "time out" maybe useful when it's a long distance(is
[quoted text clipped - 5 lines]
> Maybe the user presses the Cancel button? (I.e., some non-timer
> external event...)
Yes, I want to provide a "Cancel" button to stop waiting when it's
trying to connect to remote.
how can I do with this "Cancel" button?
Esmond Pitt - 19 May 2007 06:52 GMT
> Yes, I want to provide a "Cancel" button to stop waiting when it's
> trying to connect to remote.
> how can I do with this "Cancel" button?
Try
socket = new Socket();
socket.connect(...);
That way there is an existing socket object for the cancel button to
close, whereupon 'Any thread currently blocked in an I/O operation upon
this socket will throw a SocketException.'
JTL.zheng - 21 May 2007 16:50 GMT
> Try
>
> socket = new Socket();
> socket.connect(...);
Thank you very much
It works!
: )