什么是 java.net.SocketTimeoutException:无法从远程连接接收关闭确认?

发布于 2024-09-04 12:19:15 字数 292 浏览 10 评论 0原文

我正在通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

揪着可爱 2024-09-11 12:19:15

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.

秉烛思 2024-09-11 12:19:15

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文