-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Error: This socket is closed. #74
Comments
Just upgraded to node.js 0.6.18, but I'm not too optimistic... I really don't understand when socket.write throws an exception and when it emits an 'error' event. You are try/catching exceptions, so either the write must be delayed, or emitting an error event which is not caught by the default http error handler (https://github.com/joyent/node/blob/master/lib/http.js#L1311) for some reason. Maybe a check if the socket is still writable in Let's see if node 0.6.18 fixes or at least spits out a better backtrace. |
Update: it crashed again:
Now trying to add |
So far no crashes, but I'll observe it over the day. These handlers should be in |
Update: still crashes even if I catch the socket's
|
I have no idea
Now I added a check for |
Does #75 work for you? I have a different fix brewing, which seems to be a more long-term way to handle this issue. That'll take me a couple of hours to implement, though. |
@einaros: so far it seems so... How would you like to handle it other that that? Seems like node's socket.write is quite a mess, as it can a) throw exceptions b) return false and c) emit an 'error' if something goes wrong... |
Closing this - let's reiterate if the current fixes aren't sufficient :) |
I just got this crash:
node.js 0.6.17, ws 0.4.15.
I think (!) this has nothing to do with the latest update of WebSocketServer.js – and I wonder why this error was not caught by the try/catch (maybe this is a deferred thing again, and you have to check if the socket is open before the writes).
The text was updated successfully, but these errors were encountered: