java socket超时出现 read time out 错误(服务端)
这段代码本来意思是当服务端接收不到数据的情况下,时间超过10秒,就抛出socketexception异常,显示!!!连接超时!!!,然后再尝试给客户端发送一个心跳包,如果...
这段代码本来意思是当服务端接收不到数据的情况下,时间超过10秒,就抛出socketexception异常,显示!!!连接超时!!!,然后再尝试给客户端发送一个心跳包,如果捕获到异常,则说明客户端已经下线,但是现在超时时间到了就会报read time out错误,求解
这是报错信息:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.net.SocketInputStream.read(SocketInputStream.java:90)
at receive.ReceiveData_7.ReceiveData(ReceiveData_7.java:44)
at returndata.ReturnData_6.ReturnData(ReturnData_6.java:34)
at treatment.UploadTreatment.Upload_Treatment(UploadTreatment.java:84)
at receive.ReceiveTreatmentData_3.ReceiveData(ReceiveTreatmentData_3.java:143)
at listenport.ListenPort_1$CreateServerThread.run(ListenPort_1.java:59)
不好意思,没有分了,帮帮忙吧 展开
这是报错信息:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.net.SocketInputStream.read(SocketInputStream.java:90)
at receive.ReceiveData_7.ReceiveData(ReceiveData_7.java:44)
at returndata.ReturnData_6.ReturnData(ReturnData_6.java:34)
at treatment.UploadTreatment.Upload_Treatment(UploadTreatment.java:84)
at receive.ReceiveTreatmentData_3.ReceiveData(ReceiveTreatmentData_3.java:143)
at listenport.ListenPort_1$CreateServerThread.run(ListenPort_1.java:59)
不好意思,没有分了,帮帮忙吧 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询