Issue pertaining to the WebSocketConnection class in method isConnected()

#1

Hi,

I am using the Websocket Library provided by Autobahn in one of my Android client code and I have downloaded the code for the same on April 15th, 2012. I am having an issue where in if I move from 4G connection to a Wifi connection the method WebSocketConnection.isConnected() returns a false to me but when I move back from Wifi to 4g connection, WebSocketConnection.isConnected() returns true always and due to which I am having issues as I want to have a new websocket connection whenever there is a change in the connectivity but it doesn’t work that way so I have done a small modification in the isConnected() method in such a way that I manually null out mTransportChannel = null; based on the flag set by me from moving from Wifi to 4g. Here is the modified code for the same.

public boolean isConnected() {
if(StartReceiveServiceReceiver.dropWebsocket == true)
mTransportChannel = null;
return (mTransportChannel != null && mTransportChannel.isConnected());
}

Can you please review the code at your end and let me know if the issue is reproducible by you or it has been fixed already in the latest version of the code?

Thanks,
Bhupendra.

0 Likes

#2

There hasn’t been changes to code relevant to your issue since then. Unfortunately, I don’t have time right now to setup something trying to reproduce your issue. Could you file an issue on GitHub AutobahnAndroid so we can come to it? Thanks!

···

Am Dienstag, 19. Juni 2012 23:23:42 UTC+2 schrieb Bhupendra Kumar Jain:

Hi,

I am using the Websocket Library provided by Autobahn in one of my Android client code and I have downloaded the code for the same on April 15th, 2012. I am having an issue where in if I move from 4G connection to a Wifi connection the method WebSocketConnection.isConnected() returns a false to me but when I move back from Wifi to 4g connection, WebSocketConnection.isConnected() returns true always and due to which I am having issues as I want to have a new websocket connection whenever there is a change in the connectivity but it doesn’t work that way so I have done a small modification in the isConnected() method in such a way that I manually null out mTransportChannel = null; based on the flag set by me from moving from Wifi to 4g. Here is the modified code for the same.

public boolean isConnected() {
if(StartReceiveServiceReceiver.dropWebsocket == true)
mTransportChannel = null;
return (mTransportChannel != null && mTransportChannel.isConnected());
}

Can you please review the code at your end and let me know if the issue is reproducible by you or it has been fixed already in the latest version of the code?

Thanks,
Bhupendra.

0 Likes