什么是 java.net.SocketTimeoutException:无法从远程连接接收关闭确认?
我正在通过 LAN 传输文件(使用 JxtaSocket,以防万一您听说过它),并且收到:
java.net.SocketTimeoutException:无法从远程连接接收关闭确认。 在 net.jxta.socket.JxtaSocket.close(JxtaSocket.java:1046)
我想知道首先发生这种情况的原因是什么。在发送一个文件(2.9 mb)后,我定期收到此异常。所有其他文件均小于 1 Mb,并且工作正常。
另一方面,我想这可能是 JXTA 的错。
任何回应都将受到高度赞赏!
I'm transfering a file across a LAN(using JxtaSocket in case you heard about it) and I receive:
java.net.SocketTimeoutException: Failed to receive close ack from remote connection.
at net.jxta.socket.JxtaSocket.close(JxtaSocket.java:1046)
I would like to know what are the reasons this would happen in the first place. I'm receiving this exception at a regular pace, after I send one file(which is 2.9 mb). All other files are under 1 Mb and work fine.
On the other hand, it might be JXTA's fault I suppose.
Any response will be highly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
JXTA 社区的一些成员在 2.5 版本中遇到过此类问题,但在 2.6 和 2.7 中已经消失。这可以解释/解决这个问题。
Some members of the JXTA community have experienced such issues with release 2.5, but it has disappeared in 2.6 and 2.7. This could explain/solve that.
TCP 是一个复杂协议。
其中一部分是,当客户端关闭其连接时,请求方(最初尝试关闭的一方)必须等待另一方的关闭确认,以确保远程方知道我们正在关闭连接。不幸的是,关闭握手无法正确发生是很常见的(有时客户端只是关闭而不是正确地进行握手)。实际上这并不重要,因为所有重要的通信都已完成。
长话短说,您在这里最有可能看到的是行为不端的客户,但我不会担心。
维基百科对 TCP 连接终止协议有很好的讨论
TCP is a complicated protocol.
One part of it is that when clients are shutting down their connection the requesting side (the side that initially tried to close) has to wait for a close acknowledgment from the other side, to make sure that the remote side knows that we are closing down the connection. Unfortunately it is common for the shutdown handshake not to occur properly (sometimes clients just close instead of properly going through the handshake). In practise this doesn't really matter because all the important communication is done.
so long story short, what you are most likely seeing here is a misbehaving client, but i wouldn't worry about it.
Wikipedia has a good discussion of the TCP connection termination protocol