This only happens on node.js 0.6.x, 0.4.x was fine. My node.js version is 0.6.6 (from homebrew, mac os x lion, but linux version is affected too). This may be not a but, maybe I just misread docs. Should it say that the server is closed when all connections destroyed?
What should you do to reproduce?
- In the first terminal tab:
node test-net.js
- In the second terminal tab:
telnet 127.0.0.1 1234
-
In the first terminal tab
^C
to callserver.close
(connection from the second tab is still alive) -
Server still not emit
close
event (this is weird, not?) -
Terminate telnet from the second terminal
-
Server in the first tab emits close and successfully exit.