-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
the connection.handshake.address object is sometimes undefined #1042
Comments
I have a same problem. And I use clusters + redis to sync sockets between processes. In app without it - this problem wasn't present. I came up with a way to prevent: var socket_ip = (socket.handshake != undefined && socket.handshake.address != undefined) ? socket.handshake.address.address : "IP_ERROR"; but it isn't a solution. sometimes my app has a dead-sockets in some processes, but in some other they aren't. So this is just a way to prevent crashing your app. It may be because there are a lot "client not handshaken" so that's why socket.handshake is undefined? |
hashi101, many thanks for this fix. Just giving it a try now, hopefully it will stop my app from crashing :-) |
Worked like a charm. Thank you sir! |
Thats pretty much it.
Im expecting connection.handshake.address.address to contain the IP address related to the client, but i sometimes randomly get a ReferenceError there, as connection.handshake.address seems to be undefined.
Node 0.8.x
Socket.IO latest
The text was updated successfully, but these errors were encountered: