Java: socket read time out exception

前端 未结 3 1688
说谎
说谎 2021-01-02 00:44

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

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-02 00:54

    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

提交回复
热议问题