unix: Expose tcp start and stop externally #863

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Exposing these to allow hooking into and stopping tcp requests on a connection while allowing current connections to continue.

I didn't patch the Win32 files because I'm not a windows guy. I'll be happy to add it for feature parity if someone can give me a hand.

This request will also have a counterpart in Node land to expose this API to JS

@davglass davglass unix: Expose tcp start and stop externally
    Exposing these to allow hooking into and stopping
    tcp requests on a connection while allowing
    current connections to continue.
8fbf89f
Contributor

bnoordhuis commented Jul 25, 2013

I confess I don't get it. What's wrong with uv_read_start() and uv_read_stop()?

If I'm reading them right, which I may not be, using uv_read_start/stop would stop all reading of the streams, even current ones. Where what we are looking for is the ability to not accept any new connections, but still letting current connections complete.

Contributor

bnoordhuis commented Jul 25, 2013

uv_read_start() and uv_read_stop() work on a per-stream basis.

If you have a server handle and want to stop accepting new connections without closing the handle, well, you can't really do that right now.

Your patch partially accomplishes that but in a somewhat ad-hoc and TCP-specific fashion.

What you want is a uv_listen_stop() function. It's relatively trivial to implement on Unices, probably less so on Windows because you have to worry about in-flight requests. @piscisaureus can fill you in on the details.

Cool, I'm willing to do what I can to get this feature in. We have been using this feature internally for a while now and it does what we need (provide a graceful shutdown on a process).

davglass commented Oct 2, 2013

Hey @piscisaureus, we talked briefly about this at NodeConfEU and you mentioned that it could be solved by re-implementing the pause method.

Just pinging so you remember :)

Thanks

Ping @piscisaureus again :)

Contributor

saghul commented Feb 12, 2014

Closing this since the patch cannot land in its current form and there was no followup. Feel free to work on a patch and open a new pull request :-)

saghul closed this Feb 12, 2014

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