LearnBoost/engine.io-client — Issue #18: race condition when polling and upgrading
Author: ruxkor
Created: 2012-02-20 18:56:51+00:00
State: open

if there is an ongoing polling request and the client is not receiving any data, the upgrade blocks until the client gets a response on the poll, usually a `ping` packet. this makes the usage of websockets difficult, if the server is not continously sending messages.

this behavior can be observed more often if connecting to a remote server; it almost never happens if connecting via localhost in my tests.

### tracebacks:

first part:

```
debug : polling
debug : xhr poll
debug : sending xhr with url http://.../engine.io?uid=944483157247398450060002506&transport=polling&sid=7954197634546385 | data null
debug : probe transport "websocket" opened - pinging
debug : probe transport "websocket" pong - upgrading
debug : pausing current transport "polling"
debug : we are currently polling - waiting to pause
```

(after 20 seconds)

```
debug : polling got 1:2
debug : socket receive: type "ping" | data "undefined"
debug : pre-pause polling complete
debug : paused
debug : changing transport and sending upgrade packet
debug : clearing existing transport
```