-
Notifications
You must be signed in to change notification settings - Fork 8
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
Server crashes when you unexpectedly drop an established websocket connection. #1
Comments
Would using socket.io be a good fix for that, or is that excessive? I ask only because AFAIK socket.io already has this sort of error handling and much more. Or would it be better to create a socket-io-networking bundle? |
A separate socket io bundle would be quite cool. |
A working solution I found is related to this thread and this comment in the ws repo. Upon every new inbound connection, attach an error listener to the websocket that is created:
|
I like this as a good-enough solution, then if people want to do different handling for specific errors they can easily add their own listeners to the socket IIRC. |
I upgraded ws to latest and made a yarn install in the bundle and it worked fine |
`events.js:167
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:139:27)
Emitted 'error' event at:
at WebSocket.finalize (/Users/jared/Dev/ranviermud/bundles/ranvier-websocket/node_modules/ws/lib/WebSocket.js:182:41)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process.internalTickCallback (internal/process/next_tick.js:72:19)`
I seem to be able to replicate it pretty easily by simply connecting to the server with Neuro (which I'm running in a browser) and then closing the browser tab after I've already logged in to a character.
The text was updated successfully, but these errors were encountered: