Open
Description
i am implementing chat app using this socket io. its working fine now i am getting one issue is that socket reconnecting again and again if socket connection off, i like this its handing own no need to handle manually. but in second scenario, when i switched off network or data connection of mobile then i used this code for socket off
public static void stopConnection() { try { if (mSocket != null) { mSocket.disconnect(); mSocket.close(); } } catch (Exception e) { e.printStackTrace(); } }
but its not working. socket making connection again and again and getting Error when network connection switched off. how can we handle this situation?