-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Closed
Description
My server is crashing on:
this.connection.addListener('data', function(data){
^
TypeError: Cannot call method 'addListener' of null
@transports/websocket.js:101
I traced the error and I found out that this.connection is set to null because of an error in WebSocket.prototype._write:
Error: Stream is not writable
at Stream._writeOut (net:687:11)
at Stream.write (net:673:17)
at [object Object]._write (/usr/local/lib/node/.npm/socket.io/0.6.3/package/lib/socket.io/transports/websocket.js:168:21)
at [object Object]._payload (/usr/local/lib/node/.npm/socket.io/0.6.3/package/lib/socket.io/client.js:102:28)
at [object Object]._onConnect (/usr/local/lib/node/.npm/socket.io/0.6.3/package/lib/socket.io/transports/websocket.js:96:8)
My temporary fix to stop the crashes is to add
if ( !this.connection ) return;
just before
this.connection.addListener('data', function(data){
@transports/websocket.js:101
Metadata
Metadata
Assignees
Labels
No labels