On Wed, May 14, 2014 at 5:36 PM, Saúl Ibarra Corretgé <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 05/14/2014 05:30 PM, Iñaki Baz Castillo wrote: >> 2014-05-14 17:27 GMT+02:00 Saúl Ibarra Corretgé >> <[email protected]>: >>> Currently there is no API for that. I've been wanting to add it >>> for a while now. The API would be uv_listen_start / >>> uv_listen_stop. No ETA for it though. >>> >>> In case you want to work on it ping me so we don't duplicate the >>> work. >> >> So it will in fact close the socket right? >> >> > No, you have uv_close for that. It will stop polling for i/o. The idea > is to allow the user to control the server a bit if it's flooded with > connections. If you get EMFILE you may want to uv_listen_stop for a > bit, wait until some connections are closed, and start listening again.
Besides removing the socket from the epoll/kqueue/etc. set, uv_listen_stop() should probably also call listen(sock, 0), otherwise new connections still end up in the accept queue. On the other hand, I imagine that's sometimes the desired behavior. -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
