-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
While testing the current master of engine.io/websocket.io we encountered the following error: [1]
I think the reason for this is an inconsistency between WebSocket
objects in websocket.io
and ws
; the former only calls ws.write
if it's readyState == 'open'
, and the latter throws an error if it's readyState != WebSocket.OPEN
Changing ws/WebSocket's behavior to emit
instead of throwing errors (since it inherits from EventEmitter
) makes the handling easier, but does, of course, not provide a remedy for this problem.
I am still trying to figure out a way to reproduce the error and will update the issue if I find something of relevance.
[1]
/my/app/node_modules/long-stack-traces/lib/long-stack-traces.js:81
throw e;
^
Error: not opened
at WebSocket.send (/my/app/node_modules/engine.io/node_modules/websocket.io/node_modules/ws/lib/WebSocket.js:175:16)
at WebSocket.write (/my/app/node_modules/engine.io/node_modules/websocket.io/lib/protocols/hybi.js:101:13)
at WebSocket.send (/my/app/node_modules/engine.io/node_modules/websocket.io/lib/socket.js:105:8)
at WebSocket.send (/my/app/node_modules/engine.io/lib/transports/websocket.js:69:17)
at Socket.flush (/my/app/node_modules/engine.io/lib/socket.js:237:20)
at Socket.sendPacket (/my/app/node_modules/engine.io/lib/socket.js:223:10)
at Socket.send (/my/app/node_modules/engine.io/lib/socket.js:207:8)
at Socket.send_ns (/my/app/node_modules/engine.ns.io-base/lib/engine.ns.io-base.coffee:38:19)
at /my/app/server.coffee:161:27
at Socket.get (/my/app/server.coffee:120:14)
----------------------------------------
at EventEmitter.on
at Object.<anonymous> (/my/app/server.coffee:150:23)
....
Metadata
Metadata
Assignees
Labels
No labels