TCP keepalives sent too early and terminates connection
I'm trying to implement an persistent TCP connection between an Android phone and a desktop server.
I've got heartbeat threads on both ends which are sending keepalive-packets on application level successfully.
The problem is that after a while (varies between 5-20min) the phone is starting to send TCP keepalives to the server, which the server does not seem to respond to. (I'm using Wireshark to monitor this).
This results in an exception on the server thread which is reading from the phone:java.net.SocketException: Connection reset
Why are the phone sending TCP keepalives so early? Even when there's constantly activity on application level? And why doesn't the desktop server respond to this keepalives?
I've checked my Android phone's settings with "sysctl -A | grep net.ipv4" and "net.ipv4.tcp_keepalive_time" is set to 7200 (2 hours).
Thanks.
Re: TCP keepalives sent too early and terminates connection
Sorry, I placed this thread very wrong. If a mod can be kind and move it to Java programming or anything? Thanks.
Re: TCP keepalives sent too early and terminates connection
hi,
I'm trying to implement an persistent TCP connection between an Android phone and a desktop server.
Why are the phone sending TCP keepalives so early? Even when there's constantly activity on application level? And why doesn't the desktop server respond to this keepalives
regards,
phe9oxis,
http://www.guidebuddha.com