Fixed server hanging on close #215

wants to merge 1 commit into


None yet

2 participants


I ran into an issue with WebSocketServer not shutting down cleanly.

I traced it to the fact that I'm closing all the open sockets right before closing the server (due to some business logic that handles other cases as well), which causes two terminate calls to open sockets in rapid succession, which causes a zombie 30s timeout for cleanupWebsocketResources.

Fixed by clearing close timer in socket if terminate is called more than once in rapid succession.

Here is a gist displaying the issue: (the example is a bit contrived, but that's the underlying problem I'm having). To get it working just run the server and connect with a client (I'm using

3rd-Eden commented Dec 5, 2014

Fixed in master.

@3rd-Eden 3rd-Eden closed this Dec 5, 2014
kenpratt commented Dec 5, 2014


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment