Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
socket_shutdown($socket, 2);を実行してシャットダウンした直後にソケットが閉じられているにもかかわらず、ソケットが CLOSE_WAIT 状態のままになることがあるのはなぜsocket_close($socket);ですか?
socket_shutdown($socket, 2);
socket_close($socket);
そうではありません。CLOSE_WAIT は、ローカル アプリケーションがこのエンドを閉じる前に、ピアから着信クローズを受信したために発生します。アプリケーションがこの端を閉じると、状態が遷移します。シャットダウンは関係ありません。