-
Notifications
You must be signed in to change notification settings - Fork 10.1k
io.emit causes 4undefined frame #2590
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
Comments
I'm thinking you should simplify the problem to a code sample you're comfortable with posting. Are you fully updated? Talking about Engine.IO ? When you require ("socket.io")( do you pass a port? ) or arguments? |
Simplified, this is what I am doing,
The below code works, I am able send back to the client using the socket object.
However, the below causes 4undefined frame.
or any type of operation using the io object, For example:
I've tried using the latest version of socket.io (v1.4.6). Do note that the same code works locally. |
Do you put the "to" inside the on 'connection' ? |
Does it change if you force long-polling? or maybe
Not as a solution just checking for possible reasons. I'm guessing some port is blocked. Maybe try a different port like 4321? (oh right 3000 how about 80 then?) Can you access this from both ends? Heavier document saying Proxies can cause problems etc. |
Well if your on AWS using ELB this might be useful. It might be what's happening wherever you are hosting. Another link that might help This Chrome plugin might be useful too You can also do this in the browser for extra debugging info.
Then you can get a break point into the stack at some point like the log socket.io.js:2708 and try to trace in there that way. I guess you could dig further by trying this snippet in Engine.IO the Client code. |
Thank you for your exhaustive and wonderful list of solutions and tips. However, After much search I was able to pin-point the error to the issue below by printing socket.id and socket.client.id, This seems to be a known consequence of the latest versions of socket.io. This issue is still open (2405) and will be resolved in the next release (maybe). They should at least point this out somewhere, considering that this a serious issue. So, Manually degrading socket.io 1.3.* did the trick. All is working well. (On a side note, I am still puzzled as to why only operations on socket worked properly previously as the above issue should have broken that functionality too. Weird!) Thank you for your time. |
The nodejs servers are set up on AWS EC2 instances with Nginx as the primary load balancer. I'm implementing a the concept of "rooms" with socket.io 's redis adapter and found no work around for this issue.
I can see from my chrome's "network" tab in debug mode that, it switches to websocket. In the Frame's tab of the web socket, I can see all the information sent to and back from the nodejs server.
Any operation with socket.emit is proper and returns the proper object as 4["actual_content"] frame and is received by the client but any operation with io object (all operation done with io) returns a 4undefined frame.
Please note that, there seems to be no code issue as the same setup works perfectly when implemented locally on my machine.
Thank you for your help.
The text was updated successfully, but these errors were encountered: