I trying to make a call to a very heavy duty process. It\'s average work length is estimated by 9-10 minutes.
When I\'m executing the process, I set the timeout for
I had the same problem and the solution was not use
socket.shutdownInput(); socket.shutDownOutput();
until the last time of reading or writing data to the socket. This made the socket go to FIN_WAIT state thus waiting 2 minutes before closing. You can read more about it in this post
Clearly you aren't setting the timeout you think you're setting, or someone else is changing it afterwards. You'll have to post some code to get further elucidation.
Note that according to W.R. Stevens in TCP/IP Illustrated, Vol II, #17.4, the timeout is held in a short as a number of 1000Hz ticks, so a timeout beyond 11 minutes isn't possible. This applies to the BSD code.
I'm not sure how your application works, but try to set an infinite timeout to the socket
public void setSoTimeout(int timeout) throws SocketException
Enable/disable
SO_TIMEOUT
with the specified timeout, in milliseconds. With this option set to a non-zero timeout, aread()
call on theInputStream
associated with this Socket will block for only this amount of time. If the timeout expires, ajava.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.
If you provide more information about your call, i may improve the answer.