如何在Solaris10中发送ACK数据包
对于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检测断开连接的可靠方法是将 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).
如果您只是接收,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.
您首先发布声明 Solaris 10 支持 TCP keepalive,后来又说它不支持...
Solaris 支持使用 ndd 命令全局设置 tcp keepalive,例如:
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:
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