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

Cannot call method 'packet' of null #337

kitek opened this Issue Nov 10, 2011 · 5 comments


None yet
5 participants
Copy link

kitek commented Nov 10, 2011

Hi, when call event connect_failed I got error:

TypeError: Cannot call method 'packet' of null
at Socket.packet (/opt/node-0.4.12/lib/node/
at SocketNamespace.packet (/opt/node-0.4.12/lib/node/
at SocketNamespace.emit (/opt/node-0.4.12/lib/node/
at SocketNamespace.<anonymous> (/home/node/test.js:104:10)
at SocketNamespace.$emit (/opt/node-0.4.12/lib/node/
at SocketNamespace.onPacket (/opt/node-0.4.12/lib/node/
at Socket.onPacket (/opt/node-0.4.12/lib/node/
at Transport.onPacket (/opt/node-0.4.12/lib/node/
at Transport.onData (/opt/node-0.4.12/lib/node/
at [object Object].stateChange (/opt/node-0.4.12/lib/node/

This comment has been minimized.

Copy link

mindon commented May 14, 2012

it seems the issue comes in benchmark.
when the websocket response slow & the connectTimeoutTimer triggered,
the transport method is switched from websocket to xhr-polling
--- the socket status is: .connected === true, .transport === null

then if .packet method (socket.js line 293) or .onClose method (socket.js line 279) is called, the error will be thrown.

another 2 calls may throw error for the same issue:
.transport.payload around line 311
.transport.close around line 455


This comment has been minimized.

Copy link

mdahiemstra commented Oct 12, 2012

Any new thoughts on a fix? Got the same issue. But not really predictable when. Usually around 10k concurrent users but sometimes at 20+k. Has this got to do something with the client server on which running the benchmark? That it can't keep up. If I change the transport to websockets only it seems to happen less. But then i'm getting warn - client not handshaken client should reconnect messages around 17k conc. users


This comment has been minimized.

Copy link

xsellier commented Jul 3, 2014

Still happening


This comment has been minimized.

Copy link

rauchg commented Jul 4, 2014

Does this happen in 1.0 ?


This comment has been minimized.

Copy link

xsellier commented Jul 4, 2014

I don't know, I have to use the version 0.9.6 due to dependencies.

@rauchg rauchg closed this Nov 25, 2014

lattmann pushed a commit to lattmann/ that referenced this issue Jul 23, 2015

Merge pull request socketio#337 from 3rd-Eden/handshakeData
Expose path and querystring in handshakeData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.