Closed josephg closed 13 years ago
The sendClose() method immediately above the code you've quoted initiates a graceful shutdown sequence with the server. We intentionally wait for the server's close frame to complete shutdown of the connection. This happens in serverCloseHandler().
The nonstandard timeout parameter was added to the close() method to handle the case of servers that do not correctly handle this close flow. When I last tested this, miksago/node-websocket-server didn't handle close, for example.
Ah.
miksago/node-websocket-server is the one I'm using. I'll file an issue there, and keep using the timeout value for now.
Thanks :)
In close():
Currently if you don't pass a timeout to close, finishClose is never called, and the socket is never cleaned up.
Maybe something like this would be appropriate:
... or maybe a have a default value for timeout?