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

Rapid Reconnections In Firefox #29

Closed
bendytree opened this issue Aug 20, 2013 · 6 comments
Closed

Rapid Reconnections In Firefox #29

bendytree opened this issue Aug 20, 2013 · 6 comments

Comments

@bendytree
Copy link

I recently moved to Primus/Engine.IO from Socket.IO and it's been excellent.

Today a user reported that he kept seeing a "Connecting" message flash on & off. We listen for connection changes and show an error if they're disconnected. He's on a WiFi connection running iPad OS 6.1.3.

I was able to reproduce it on Firefox 23.0.1 on Windows 7. Here's a live link to the page where it happens:
http://draft.bz/draft

Looking at the console logs, it's clearly trying to reconnect multiple times per second. I've linked a gist of what gets logged over and over, but here's a quick version:

"NetworkError: 400 Bad Request - https://mysite.com/primus/?EIO=2&transport=polling&sid=VV_2AW6uTCxS_ADqAAMt"

Firefox can't establish a connection to the server at wss://mysite.com/primus/?EIO=2&transport=websocket&sid=VV_2AW6uTCxS_ADqAAMt.

The connection to wss://mysite.com/primus/?EIO=2&transport=websocket&sid=VV_2AW6uTCxS_ADqAAMt was interrupted while the page was loading.

GET https://mysite.com/primus/?EIO=2&transport=polling 200 OK

GET https://mysite.com/primus/?EIO=2&transport=polling&sid=Z8GdxtIynXXnjdFOAAMu  400 Bad Request

https://gist.github.com/bendytree/80b0e257e9868c522957

Any ideas what could be up? Obviously this could be a problem with Engine.IO or my code, but it does seem to work on most browsers. And shouldn't Primus prevent quick reconnects? From what I can tell, it happens about 2 times per second.

@cayasso
Copy link
Contributor

cayasso commented Aug 20, 2013

@bendytree Have you tried another transformer like SockJS or pure Websockets, to see if you get the issue still?

@jcrugzz
Copy link
Contributor

jcrugzz commented Aug 21, 2013

@bendytree the reconnection is expected behavior as there is exponentially-weighted backoff built into the primus client. Those don't seem like expected connection attempts though. I'd definitely run a test to see if you can replicate the behavior with a different transport like @cayasso said.

@bendytree
Copy link
Author

Thanks everyone -

I replaced Engine.IO with SockJS and it fixed the problem. So it is an Engine.IO problem.

I hope SockJS keeps working... I'm about out of socket libraries to try.

[ ] Socket.IO - DDoSed my server
[ ] Engine.IO - Rapid reconnection loop on various browsers
[x] SockJS - Works well so far

@3rd-Eden
Copy link
Member

Effortless switching between backends ftw :D

@cayasso
Copy link
Contributor

cayasso commented Aug 21, 2013

Nice!

@jcrugzz
Copy link
Contributor

jcrugzz commented Aug 21, 2013

huzzah!

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

4 participants