SkyZ3T / ga-bitbot

Automatically exported from code.google.com/p/ga-bitbot
GNU General Public License v3.0
0 stars 0 forks source link

server.js crashes on null websocket messages #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
$ node server.js
   info  - socket.io started

/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client
/lib/socket.js:327
    this.transport.payload(this.buffer);
                   ^
TypeError: Cannot call method 'payload' of null
    at Socket.flushBuffer (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/socket.js:327:20)
    at Socket.setBuffer (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/socket.js:314:14)
    at Socket.onConnect (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/socket.js:409:14)
    at Transport.onConnect (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/transport.js:139:17)
    at Transport.onPacket (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/transport.js:91:12)
    at Transport.onData (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/transport.js:69:16)
    at WebSocket.WS.open.websocket.onmessage (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/transports/websocket.js:73:12)
    at WebSocket.onMessage (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/node_modules/ws/lib/WebSocket.js:323:18)
    at WebSocket.EventEmitter.emit (events.js:99:17)
    at Receiver.self._receiver.ontext (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/node_modules/ws/lib/WebSocket.js:520:10)

Original issue reported on code.google.com by brian.mo...@gmail.com on 14 Feb 2013 at 1:16

GoogleCodeExporter commented 9 years ago
Adding another case:

timers.js:103
            if (!process.listeners('uncaughtException').length) throw e;
                                                                      ^
TypeError: Cannot call method 'onClose' of null
    at Object._onTimeout (/home/emfb/Desktop/ga-bitbot/ga-bitbot/tools/nimbs/node_modules/socket.io-client/lib/socket.js:281:22)
    at Timer.list.ontimeout (timers.js:101:19)

Original comment by brian.mo...@gmail.com on 7 Mar 2013 at 4:27

GoogleCodeExporter commented 9 years ago
Posted by JoeMattie on the forums : 

Go to ga-bitbot/tools/nimbs/node_modules/socket.io/lib

open manager.js and replace this line:

this.oldListeners = server.listeners('request').splice(0);

with these two lines:

this.oldListeners = server.listeners('request').slice(0);
server.removeAllListeners('request');

This solution worked for me.

Original comment by hikkak...@gmail.com on 1 Apr 2013 at 2:01