Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Problem with websokects

Hello,

I have the following code in javascript:


var support = "MozWebSocket" in window ? 'MozWebSocket' : ("WebSocket" in window ? 'WebSocket' : null);

function ConnectWebSocket() {

myWebsocket = new window[support]("wss://myserver/mychannel");

myWebsocket .onmessage = function (evt) {

alert("onmessage");

}

myWebsocket .onopen = function () {

alert("onopen");

}

myWebsocket .onclose = function () {

alert("onclose");

ConnectWebSocket();

}

}

ConnectWebSocket();


The problem is that in Firefox, the connection is opened and just after closed. Maybe the connection keep opened for a 2-3 seconds and after it is closed, and reopened again due to the call to ConnectWebSocket()


Can someone help me? In other browsers like IE or Chrome, once the connection is created, it keep opened until I leave the page. I have the 40.0.3v of Firefox


Thank you.

Other OS, Safari on Windows10 websocket error

Posted on Sep 18, 2015 12:07 AM

Reply
1 reply

Problem with websokects

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.