[连接技术] 如何解决error 10054 during TCP read
fobme
2007-07-20
我做的是基于j2me的小型智益类游戏,服务端是用C++写的,在使用WTK模拟器在电脑上测试时,java客户端连接服务端时间一长就会出现:
java.io.IOException: error 10054 during TCP read at com.sun.midp.io.j2me.socket.Protocol.nonBufferedRead(+7) at com.sun.midp.io.BufferedConnectionAdapter.readBytes(+39) at com.sun.midp.io.BaseInputStream.read(+39) 请问如何解决!在网上查了一下资料,但没有找到好一些结果,希望和大家交流交流! |
|
Puras
2007-07-24
我也遇到过这种问题
但一般都是服务器响应错误 重新连一次问题就没有了 也没有搞明白是什么问题. |
|
fobme
2007-07-24
Puras 写道 我也遇到过这种问题
但一般都是服务器响应错误 重新连一次问题就没有了 也没有搞明白是什么问题. 重新连一次,那么就是续连,这里我们考虑到的是游戏玩家不喜欢经常续连咯,所以想把这问题彻底解决掉! |
|
fobme
2007-07-26
自己再回回贴咯,呵呵。下面是在网上找到的一些可能出现该问题的原因:
10054 Connection reset by peer. An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET. |
|
wuhua
2009-05-07
从HttpConnction中看到有这么一项,不知道效果如何。
socket.setSocketOption(SocketConnection.DELAY, 0); |
|
yanggulei
2009-11-27
这个是设置代理联网方面的错误
|