Reputation: 553
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);
?
Upvotes: 1
Views: 571
Reputation: 311018
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.
Upvotes: 1