Sometimes java.net.SocketTimeoutException: Read timed out. Sometimes not

我怕爱的太早我们不能终老 提交于 2019-12-07 05:40:17

问题


I have this strange error with the

java.net.SocketTimeoutException: Read timed out

And maybe someone of you can help to fix this problem.

The facts are these, I'm working with Eclipse, with a Tomcat v7. Then I execute a function which have

_call.setTimeout(3500);

In my Windows->Preferences->Java->Debug I have

Debugger timeout(ms):3000
Launch timeout(ms):20000

In my Servers->Tomcat v7.0->Timeouts I have

Start(in seconds): 45
Stop(in seconds): 15

Now, when I run my WebService, sometimes it works perfect, sometimes I get the RemoteException e2: java.net.SocketTimeoutException: Read timed out

Did I set the Timeout correctly? Because I tried to change it and stills happens the same, sometimes gets the error, sometimes not.


回答1:


Apparently, sometimes the call you are making takes longer than 3.5 seconds to complete. In that case, getting a SocketTimeoutException is the expected behavior.



来源:https://stackoverflow.com/questions/16788078/sometimes-java-net-sockettimeoutexception-read-timed-out-sometimes-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!