Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

0.4.x -> 0.6.x net.Server.close behavior change #2418

Closed
bobrik opened this issue Dec 26, 2011 · 6 comments
Closed

0.4.x -> 0.6.x net.Server.close behavior change #2418

bobrik opened this issue Dec 26, 2011 · 6 comments
Labels

Comments

@bobrik
Copy link

bobrik commented Dec 26, 2011

Here's my git explaining everything: https://gist.github.com/1521447

Maybe docs really should be updated? I relied on the old behavior and had some headache with updating.

@bobrik
Copy link
Author

bobrik commented Dec 26, 2011

The main question for what I want to see an answer in docs: is server stops accepting new connections immediately (sync call)?

@bnoordhuis
Copy link
Member

is server stops accepting new connections immediately (sync call)?

It's complicated. The official story is that the server is active until you receive the close event.

Back story: The server socket is closed immediately (i.e. synchronously) but you can still receive a number of 'new' connections that have been accept()-ed and queued at the start of the event loop's current tick. Hence the need to wait for the close event.

I've updated the documentation in 70e6f3f.

@bobrik
Copy link
Author

bobrik commented Dec 27, 2011

Maybe it's better to emit close when no new connections can be received? I may work around current behavior, but it should be more consistent imho.

@bnoordhuis
Copy link
Member

Maybe you're right. I've started a discussion in commit 09ee293.

@bnoordhuis
Copy link
Member

Fixed in c24276f.

@bobrik
Copy link
Author

bobrik commented Dec 30, 2011

Thanks a lot! :)

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

No branches or pull requests

2 participants