polling socket dies in first ~5 seconds #68

Closed
carlos8f opened this Issue Aug 16, 2012 · 9 comments

Comments

Projects
None yet
2 participants

With the server set up like this:

var io = engine.attach(server, {allowUpgrades: false, transports: ['polling']});

And client like:

var socket = new eio.Socket({port: this.port, transports: ['polling'], upgrade: false});

Data can be sent over the socket, but as soon as the ~5 seconds is up, socket closes with an error:

  engine:socket sending packet "open" ({"sid":"9wriKgPAqJzd6UqGAAAA","upgrades":[],"pingTimeout":60000}) +0ms
  engine:socket flushing buffer to transport +0ms
  engine:socket transport error +5s

[Error: poll connection closed prematurely]

Using Chrome 21.0.1180.75 / Mac OS X 10.8

So far, Safari doesn't seem to be affected.

I found a strange solution: the bug only happens when the client's host option is different than I am connecting to in the browser. I.e.,

var socket = new eio.Socket({host: '10.0.0.115', port: this.port, transports: ['polling'], upgrade: false});

and going to localhost:3000/ works, but going to 10.0.0.115:3000/ fails!

edit: xhr-polling only WORKS when the client's host option is different than I am connecting to in the browser.

Contributor

rauchg commented Aug 16, 2012

Well that should trigger a cross-domain poll. Maybe it's cross-domain that's failing?

Sorry, I meant that cross-domain is working and same-domain is actually broken.

Contributor

rauchg commented Aug 16, 2012

Wow, feature! jk Not sure what explains this, but I might have run into this during development haha

Contributor

rauchg commented Oct 13, 2012

@carlos8f can you still reproduce this?

I can readily reproduce this with the app below (engine.io 0.3.5)

https://github.com/carlos8f/node-chat-yardstick/tree/34bc69a4560f856f1f6a20c77af20be451772580

When you turn on upgrades it works, and when you specify a different host than you're connecting to, it works. But polling + same domain disconnects after 5 seconds with "transport error".

Contributor

rauchg commented Oct 15, 2012

Sweet thanks carlos

@rauchg rauchg closed this Feb 15, 2013

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