websocket handshake 5 seconds delay on Firefox 15

RESOLVED DUPLICATE of bug 782704

Status

()

Core
Networking: HTTP
RESOLVED DUPLICATE of bug 782704
6 years ago
6 years ago

People

(Reporter: sieroaoj, Unassigned)

Tracking

15 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
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.
(Reporter)

Updated

6 years ago
OS: Mac OS X → All
Hardware: x86 → All
Component: Untriaged → Networking: HTTP
Product: Firefox → Core
(Reporter)

Comment 1

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → INVALID
sieroaoj,

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

Comment 3

6 years ago
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.
(Reporter)

Comment 5

6 years ago
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.

Comment 6

6 years ago
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.