Sunday, April 23, 2006 10:15 AM
So, to summarise what you said: you have set up your program to do something specific in a specific case (a timeout after a certain time), and when your program encounters the specified case it does what it has been told to -- and you're asking us what you should do ?
Shall I quote the SO_TIMEOUT Javadoc ? Wouldn't that be too blunt ?
public void setSoTimeout(int timeout)
Enable/disable SO_TIMEOUT with the specified timeout, in
milliseconds. With this option set to a non-zero timeout, a
read() call on the InputStream associated with this Socket
will block for only this amount of time. If the timeout
expires, a java.net.SocketTimeoutException is raised,
though the Socket is still valid. The option must be
enabled prior to entering the blocking operation to have
effect. The timeout must be > 0. A timeout of zero is
interpreted as an infinite timeout.
timeout - the specified timeout, in milliseconds.
SocketException - if there is an error in the underlying protocol, such as a TCP error.