Do you know how can I keep alive a socket connection if I do not do any actions on the socket? I just noticed that if my connection is on background and I do not operate it I get this:
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.DataOutputStream.writeInt(Unknown Source)
So, how can I control that the connection will not be lost after some idle time and after how much time by default does it happen?