NOTE

1.6 TCP CLOSE_WAIT

The passive closer of a TCP connection enters CLOSE_WAIT. These notes examine the state and related issues through half-closed connections.

Computer NetworksCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What Is CLOSE_WAIT?

The side that passively closes a TCP connection enters the CLOSE_WAIT state.

2. Why Is CLOSE_WAIT Needed?

After the client closes the client-to-server connection, the server may still have data to send. It stays in this state to continue sending data, then closes its side once transmission is complete.

3. Problems with CLOSE_WAIT

  • Scenario: If many clients close their client-to-server connections but the server never calls close, many connections will remain in CLOSE_WAIT.
  • Solution: This usually indicates a problem in the resource-cleanup code. Check that code.

4. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub