Closed Bug 786622 Opened 12 years ago Closed 12 years ago

websocket handshake 5 seconds delay on Firefox 15

Categories

(Core :: Networking: HTTP, defect)

15 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 782704

People

(Reporter: sieroaoj, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20100101 Firefox/15.0
Build ID: 20120824154833

Steps to reproduce:

I called the websocket constructor in javascript:

var ws = new WebSocket("ws://localhost:8080/echo");


Actual results:

The server accepted the TCP connection from Firefox 15 imediatly, but firefox  did not sent the handshake request (GET /echo HTTP/1.1) immediately. It delayed that initial message 5 seconds. Only after this delay the connection was established.  In firefox 14.0.1 this delay was not present.

After the handshake all is good.


Expected results:

Firefox should have sent the websocket handshake initial message immediately and should not be waiting 5 seconds to do that.
OS: Mac OS X → All
Hardware: x86 → All
Component: Untriaged → Networking: HTTP
Product: Firefox → Core
Used wireshark to see and firefox is sending the packets imediatly, the socket layer in the server is delaying the delivery of the information. Will investigate that.

Sorry for disturbing.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
sieroaoj,

This looks like bug 782704.  What server software are you using?
Resolution: INVALID → DUPLICATE
sieroaoj,

Do please explain server side. I'm really interested in seeing how many single threaded, 1 to 1 websocket servers are out there.
Yes, if we keep seeing more server issues like this, we might have to do something about it.  Though I'm hoping they'll just get fixed to handle multiple connecting sockets.
My server was written by me in C, it is single threaded and block on the recv system call. I am seeing this beaviour, Firefox launch a connection then it closes, after that I accept a new one, and do another recv. This last recv do wait 5 seconds blocked. During the wait firefox transmits the inicial "opening handshaque" but recv will remain blocked until the server gets a TCP FIN message.

For my webapp, a home made server single threaded did do the work, but if I need it to be multithreaded, I could do that to.
sieroaoj,

Thank you for explaining your implementation. As it stands, you will need to handle multiple connections due to the HTTP speculative connections feature in firefox.
You need to log in before you can comment on or make changes to this bug.