Skip to content
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.js crashes on null websocket messages #54

Open
GoogleCodeExporter opened this issue Jan 14, 2016 · 2 comments
Open

server.js crashes on null websocket messages #54

GoogleCodeExporter opened this issue Jan 14, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

$ 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
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant