Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:09:23+00:00 2026-06-13T08:09:23+00:00

Background: Writing a websocket. Works fine in Chrome. Single connection. Works fine in Firefox,

  • 0

Background: Writing a websocket. Works fine in Chrome. Single connection. Works fine in Firefox, but it makes two connections, and I have no clue why. Same javascript, same webpage, same socket server.

Client side JS:

var ws;
doWebSocketSetup();
function doWebSocketSetup(){
    console.log('Connecting...');
    ws=new WebSocket('ws://mysocketserver.com:9300/demo');

    ws.onopen=function(){
        console.log('Connected!')
        socketSend('connect',sessionStorage.user);
        if(!sessionStorage.announce){
            socketSend('login',sessionStorage.user);
            sessionStorage.announce=true;
        }
        socketSend('view',window.location.href);
        setTimeout(function(){
            processQueue();
        },100);
    }
    ws.onmessage=function(e){
        if(e.data!='ok'){
            $.msg(e.data,{header:'Server Message',live:10000});
            console.log('Server: '+e.data);
        }
        processQueue();
    }
    ws.onclose=function(){
        console.log('Disconnected');
    }
}
var sendQueue=new Array();
function socketSend(action,data){
        var payload = new Object()
        payload.action = action
        payload.client = sessionStorage.user
        payload.data = data
        sendQueue.unshift(payload);
}
function processQueue(){
    if(sendQueue.length==0)
        return;
    var payload=sendQueue.pop()
    console.log('Sending: '+JSON.stringify(payload));
    ws.send(JSON.stringify(payload))
}

And now the server console output on Firefox:

2012-10-18 20:58:53 [info] [client 68.99.226.57:53079] Connected 94e568176299729fa8669c512fdb107d 
2012-10-18 20:58:53 [info] [client 68.99.226.57:53080] Connected 457eb971eabaeba6b6afd637755ce53c 
2012-10-18 20:58:53 [info] [client 68.99.226.57:53080] Performing handshake 
2012-10-18 20:58:53 [info] [client 68.99.226.57:53080] Handshake sent 
2012-10-18 20:58:54 [info] [client 68.99.226.57:53080] _actionConnect 
2012-10-18 20:58:54 [info] [client 68.99.226.57:53080] _actionView 
2012-10-18 20:58:58 [info] [client 68.99.226.57:53079] Disconnected - 94e5681762 99729fa8669c512fdb107d

And on Chrome:

2012-10-18 21:09:17 [info] [client 68.99.226.57:53161] Connected 3906f16fa4037cbb08a8a5d1d6094cea
2012-10-18 21:09:17 [info] [client 68.99.226.57:53161] Performing handshake
2012-10-18 21:09:17 [info] [client 68.99.226.57:53161] Handshake sent
2012-10-18 21:09:17 [info] [client 68.99.226.57:53161] _actionConnect
2012-10-18 21:09:17 [info] [client 68.99.226.57:53161] _actionView

You see on Chrome a SINGLE connection, and the appropriate handshake and actions are called. On Firefox, you two connections at the exact same time, one handshakes and performs the actions (which does what it is intended on the browser), but the second connection is kicked after 5 seconds. Is this just a Firefox thing? I am not showing two connections in Firebug, just the single connection. If it is just a Firefox thing, I can live with it as the correct data does get sent and received, but I will furrow my brow at them if this is the case.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:09:24+00:00Added an answer on June 13, 2026 at 8:09 am

    This is a bug in Firefox 15 where it creates a speculative connection that it never uses (and in fact can’t because it is a WebSocket connection rather than an HTTP connection).

    It is fixed in Firefox 16.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm from a Windows programming background when writing tools, but have been programming using
Background: I'm writing a daemon that makes outgoing TCP/IP connections. It will be running
(I'm Coming from a C# background writing iPhone apps with MonoTouch) I have a
BACKGROUND: I'm writing a single level cache simulator in C for a homework assignment,
I'm writing a plugin that is reliant on CSS3 gradient background properties. I have
I'm writing a Chrome extension, in my background.html page, it is injecting a js
Background: I'm writing ASP.NET MVC 3 Web app. I have a List<MyObject> (actually several
Some background: I am writing a application with several forms, etc. Users have to
Background I'm writing a web application and I have a stored procedure which inserts
I actually have two questions regarding the same problem but I think it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.