Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

tcp: uv_tcp_reset_timed(...) #498

Closed
wants to merge 1 commit into from
Closed

tcp: uv_tcp_reset_timed(...) #498

wants to merge 1 commit into from

Conversation

indutny
Copy link
Contributor

@indutny indutny commented Jul 21, 2012

Usually close() syscall will send a FIN packet to the other side and
wait for it's acceptance. While it's waiting, socket will persist in
system since FIN packet may get lost in the way to other side and will
need to be sent again. But when dealing with TCP clients that are
unable to do so (i.e. mobile, or clients under firewall), hanging
TIME_WAIT or FIN_WAIT2 connections will be left.

Introduced function (when followed by close() call) will send RST
packet instead of FIN, and will immediately destroy socket and remove
it from system's list.

/cc @bnoordhuis

Usually close() syscall will send a FIN packet to the other side and
wait for it's acceptance. While it's waiting, socket will persist in
system since FIN packet may get lost in the way to other side and will
need to be sent again. But when dealing with TCP clients that are
unable to do so (i.e. mobile, or clients under firewall), hanging
TIME_WAIT or FIN_WAIT2 connections will be left.

Introduced function (when followed by close() call) will send RST
packet instead of FIN, and will immediately destroy socket and remove
it from system's list.
@@ -293,6 +293,19 @@ int uv__tcp_keepalive(uv_tcp_t* handle, int enable, unsigned int delay) {
}


int uv__tcp_reset_timed(uv_tcp_t* handle, int enable) {
struct linger opt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline.

@indutny
Copy link
Contributor Author

indutny commented Nov 28, 2012

@bnoordhuis do you think this is still relevant?

@bnoordhuis
Copy link
Contributor

I'm closing this. I think we'll need to deal with linger timeouts eventually but in a more sophisticated way than simply disabling the timeout altogether.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants