如何在Solaris10中发送ACK数据包

发布于 2024-10-05 02:10:24 字数 130 浏览 4 评论 0原文

对于 tcp 连接,有没有办法在 Solaris 10 中向另一端发送 ACK 数据包,而无需其他数据(仅 ack 数据包)。

我知道我们可以通过 TCP Keep Alive 选项来做到这一点,但 Solaris 10 支持它。

For tcp connection, is there any way to send an ACK packet to the other side without other data (only the ack packet) in Solaris 10.

I know we can do that through TCP Keep alive option, but it's supported in Solaris 10.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

墟烟 2024-10-12 02:10:24

检测断开连接的可靠方法是将 null / ping / echo 类型消息构建到应用程序级协议中,并让应用程序定期发送这些消息。如果没有及时得到答复,它可以假设连接已断开。大多数旨在涉及长期连接的协议都包含这样的消息(例如,IRC、IMAP 和 SSH 都包含)。

(毕竟,即使您可以发送裸露的 TCP ACK 消息,另一端也不必响应它们,因为它本身没有收到更多数据来进行 ACK)。

The reliable way to detect disconnection is to build a null / ping / echo type message into your application level protocol, and have your application send those at regular intervals. If it doesn't get a timely answer, it can assume the connection has been dropped. Most protocols that are intended to involve long-lived connections include such a message (for example, IRC, IMAP and SSH all do).

(After all, even if you could send bare TCP ACK messages, the other end doesn't have to respond to them, since it has recieved no more data to ACK itself).

记忆で 2024-10-12 02:10:24

如果您只是接收,TCP 堆栈将自行发送大量没有数据的 ACK。然而,没有任何方法可以从应用程序发送任何类型的 ACK。

If you're just receiving, the TCP stack will send plenty of ACKs without data all by itself. There's no way whatsoever to send an ACK of any kind from an application however.

情绪少女 2024-10-12 02:10:24

您首先发布声明 Solaris 10 支持 TCP keepalive,后来又说它不支持...

Solaris 支持使用 ndd 命令全局设置 tcp keepalive,例如:

ndd -set /dev/tcp tcp_keepalive_interval 120000

OpenSolaris 和 Solaris 11 Express 支持每个套接字 keepalive 设置。
您可以使用 SO_KEEPALIVE 启用它,并使用 TCP_KEEPALIVE_THRESHOLD 和 TCP_KEEPALIVE_ABORT_THRESHOLD 对其进行调整。

http://docs .oracle.com/cd/E19082-01/819-2254/6n4iaov75/index.html

You first posting states Solaris 10 is supporting TCP keep alives and later that it doesn't ...

Solaris supports setting tcp keepalive globally with the ndd command, eg:

ndd -set /dev/tcp tcp_keepalive_interval 120000

OpenSolaris and Solaris 11 Express support per socket keepalive settings.
You can enable it with SO_KEEPALIVE and tune it with TCP_KEEPALIVE_THRESHOLD and TCP_KEEPALIVE_ABORT_THRESHOLD.

http://docs.oracle.com/cd/E19082-01/819-2254/6n4iaov75/index.html

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