I have an android app with always active socket connections. If connection lost, the app immideately reconnect to the server. Socket running in seperate thread.
I can correctly close socket in different situations. For example, when screen off or back button pressed.
I tried to override onPause, onResume, onDestroy with this:
I can correctly close socket in different situations. For example, when screen off or back button pressed.
I tried to override onPause, onResume, onDestroy. I have tried all three of these approaches,
Closing the socket explicitly:
socket.close();
Just nulling it out:
socket = null;
And I have also tried the shutdownInput method:
socket.shutdownInput();
but server continue thinking that socket is alive.
P.S.: by the way, when I recompile and run again android app the connection drops well.