-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Missing error handler on socket
. when using node.js v0.12
#2047
Comments
still the same issue --for socket.io@1.3.6 node version is 0.12.7
child_process: customFds option is deprecated, use stdio instead. ․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․ 107 passing (14s) |
That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible). |
This is still happening on node |
For now, I think you can add an empty error handler: socket.on("error", () => {}); We will remove this in the next major version, as this does not provide much value (the socket is disconnect in any case). |
We should reduce the scope of the "event" error in the next major version, as it is overloaded today: - it can be sent by the client (`socket.emit("error")`, which is a perfectly valid event name) - it can be emitted when the connection encounters an error (an invalid packet for example) - it can be emitted when a packet is rejected in a middleware (`socket.use()`) Related: #2047
:˜/test/socket.io$ npm test
child_process: customFds option is deprecated, use stdio instead.
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․
․․․․․․․․․․․․․․․․․․․․․․․․․Note: warning expected and normal in test.
Missing error handler on
socket
.Error: Illegal attachments
at decodeString (/home/test/socket.io/node_modules/socket.io-parser/index.js:290:13)
at Decoder.add (/home/test/socket.io/node_modules/socket.io-parser/index.js:238:14)
at Client.ondata (/home/test/socket.io/lib/client.js:176:18)
at Socket.emit (events.js:107:17)
at Socket.onPacket (/home/test/socket.io/node_modules/engine.io/lib/socket.js:99:14)
at WebSocket.emit (events.js:129:20)
at WebSocket.Transport.onPacket (/home/test/socket.io/node_modules/engine.io/lib/transport.js:91:8)
at WebSocket.Transport.onData (/home/socket.io/node_modules/engine.io/lib/transport.js:102:8)
at WebSocket.onData (/home/socket.io/node_modules/engine.io/lib/transports/websocket.js:75:30)
at WebSocket.emit (events.js:110:17)
at Receiver.ontext (/home/socket.io/node_modules/engine.io/node_modules/ws/lib/WebSocket.js:798:10)
at /home/socket.io/node_modules/engine.io/node_modules/ws/lib/Receiver.js:473:18
at /home/test/socket.io/node_modules/engine.io/node_modules/ws/lib/Receiver.js:357:7
at /home/test/socket.io/node_modules/engine.io/node_modules/ws/lib/PerMessageDeflate.js:217:5
at afterWrite (_stream_writable.js:361:3)
at onwrite (_stream_writable.js:352:7)
at WritableState.onwrite (_stream_writable.js:105:5)
The text was updated successfully, but these errors were encountered: