Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How this module is different from using server.close? #11

Closed
stalniy opened this issue Dec 18, 2017 · 1 comment
Closed

How this module is different from using server.close? #11

stalniy opened this issue Dec 18, 2017 · 1 comment

Comments

@stalniy
Copy link

stalniy commented Dec 18, 2017

According to Net module documentation https://nodejs.org/api/net.html#net_server_close_callback

Stops the server from accepting new connections and keeps existing connections. This function is asynchronous, the server is finally closed when all connections are ended and the server emits a 'close' event. The optional callback will be called once the 'close' event occurs. Unlike that event, it will be called with an Error as its only argument if the server was not open when it was closed.

So, how is it better than using native close function?

@thedillonb
Copy link
Owner

nodejs/node#2642 is a good read. It has to do with the keep-alive connections. You can basically keep making requests on a connection that is marked as a "keep-alive".

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

No branches or pull requests

2 participants