xsigndll
xsigndll

Reputation: 553

TCP CLOSE_WAIT state of connections - unknown cause

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

Answers (1)

user207421
user207421

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

Related Questions