socket.io-client-java icon indicating copy to clipboard operation
socket.io-client-java copied to clipboard

Socket is not reconnecting

Open GuptaKanishak opened this issue 8 years ago • 0 comments

Hi,

Below is the code which I have used for socket connection.

            IO.Options opts = new IO.Options();
            opts.forceNew = true;
            opts.reconnection = true;
            opts.reconnectionAttempts = 99999;
            opts.reconnectionDelay = 5000 * 10000;
            opts.reconnectionDelayMax = 5000 * 10000 * 2;
            opts.transports = new String[]{WebSocket.NAME};
            mSocket = IO.socket(SOCKETURL, opts);
           mSocket.connect();

Sometimes due to SockectConnectionError or timeOutException or unavailability of internet, the socket disconnects. There is no piece of code written for any event. The network change or availability has been handled by using a Broadcast Receiver. The concern is that after the socket is disconnected, its not making any re-connection attempts. Can anyone pls tell me what I am doing wrong here ?

GuptaKanishak avatar Nov 24 '17 06:11 GuptaKanishak