Skip to content

add TIME-WAIT state#246

Open
jthomas43 wants to merge 1 commit intoholepunchto:mainfrom
jthomas43:time-wait
Open

add TIME-WAIT state#246
jthomas43 wants to merge 1 commit intoholepunchto:mainfrom
jthomas43:time-wait

Conversation

@jthomas43
Copy link
Copy Markdown
Contributor

Adds TIME-WAIT (from TCP) to libudx. The idea is to keep the socket active on the side that closes first (the 'active' closer) to retransmit the final ACK packet to the remote closer if necessary. without TIME-WAIT the stream would immediately close after sending an ACK for the final END packet; if this ACK is lost on the way to the remote closer, they would be left open until they time out.

One side effect of this change is the user callback stream->on_close() is delayed on active close until the TIME-WAIT state times out. This may be a problem in real code (e.g. during shutdown) or in unit tests. The PR also adds a way to get and set the timeout time for each stream, setting it to 0 will allow streams to shutdown with minimal wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant