readyState

Jun 30, 2012 at 8:54 AM

Hello Kerry,

I'm facing with a new problem when the client is connected through wireless connection. Clients use a script that every 10 seconds checks the readyState:

    if (ws) {
        if (ws.readyState == 3) {
            Audit("RECONNECTING");
            Connect(URI, PORT);                   
        }
    }

This works good on wired connections, but on wireless the readyState is never 3 even when the connection is lost.

Do you have better working system to be used on wired and wireless connection, allowing clients to reconnect when the socket is lost?

Thanks

Gerardo

Coordinator
Jul 2, 2012 at 2:44 PM
No user report this issue to me, did you try to use on lose event together?

Sent from my Windows Phone

From: GTrotta
Sent: 6/30/2012 5:17 PM
To: kerry-jiang@hotmail.com
Subject: readyState [SuperWebSocket:361468]

From: GTrotta

Hello Kerry,

I'm facing with a new problem when the client is connected through wireless connection. Clients use a script that every 10 seconds checks the readyState:

    if (ws) {
        if (ws.readyState == 3) {
            Audit("RECONNECTING");
            Connect(URI, PORT);                   
        }
    }

This works good on wired connections, but on wireless the readyState is never 3 even when the connection is lost.

Do you have better working system to be used on wired and wireless connection, allowing clients to reconnect when the socket is lost?

Thanks

Gerardo

Jul 2, 2012 at 8:08 PM

No I didn't,

I will try and let you know.

Jul 2, 2012 at 8:14 PM

Sorry Kerry,

does onlose event exists on client?

Coordinator
Jul 3, 2012 at 2:24 AM

Of course,

http://www.w3.org/TR/2009/WD-websockets-20091222/

http://www.websocket.org/echo.html

 

 

Jul 3, 2012 at 9:48 AM

OOPS,

maybe there is a misunderstanding. You mean OnClose not OnLose.

Of course On Close is used but never fired.

Is it possible to use some ping method from client to server to test connection instead of using readyState?

Coordinator
Jul 3, 2012 at 9:52 AM

SuperWebocket supports PING fragment. But I am not sure the browser has this API. But you can defined application level ping.

 

Jul 3, 2012 at 10:43 AM

Yes, I defined application level ping and it perfectly works as far as the client is connected, when the client lose the connection the ping just told me that the client seems to be off line, the question is: how to let the client know it's disconnected?