
Description
I'm using the latest NodeJS/npm versions and I have the latest modules installed.
When a client connects and disconnects, for the most part it works perfectly fine. The server is able to detect when a client has left and the close event for that connection is called. If the connection is closed via the server (for example, a user issued a kick command) then it seems to take up to about 5 seconds before it realises the client has been disconnected.
This does not always happen however. When a client disconnects abruptly, the server sometimes is not aware of it. Despite data being written to the socket which is "closed", no errors emit and the close event for that socket connection is never called. When I attempt to "kick" the client, I call "close" on the socket and due to the fact there is no client to receive the data, it is unable to respond to the close request.
The only way I can get the server to remove the connection is to either restart it or modify the code to have it "appear" disconnected to all the other clients however the latter is more of a "quick fix".
Has anyone else experienced issues where the server still thinks a client is connected and never fires the close event on that socket despite requesting to close it?