TCP CLOSE_WAIT 连接状态 - 未知原因 [英] TCP CLOSE_WAIT state of connections - unknown cause

查看:29
本文介绍了TCP CLOSE_WAIT 连接状态 - 未知原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么socket_shutdown($socket, 2); 有时虽然通过执行socket_close($socket); 在关闭后立即关闭了套接字,但仍使套接字处于CLOSE_WAIT 状态.代码> ?

Why does socket_shutdown($socket, 2); sometimes leave the socket in the CLOSE_WAIT state although the socket is closed right after the shutdown by doing socket_close($socket); ?

推荐答案

没有.CLOSE_WAIT 是由于在本地应用程序关闭此端之前收到来自对等端的传入关闭.当应用程序关闭此端时,状态转换.关机与此无关.

It doesn't. CLOSE_WAIT is caused by the receipt of an incoming close from the peer before the local application has closed this end. When the application closes this end, the state transitions. Shutdown has nothing to do with it.

这篇关于TCP CLOSE_WAIT 连接状态 - 未知原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆