TCP keepalives sent too early and terminates connection
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: TCP keepalives sent too early and terminates connection

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Posts
    2

    Question 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.

  2. #2
    Join Date
    Aug 2010
    Posts
    2

    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.

  3. #3
    Join Date
    Aug 2010
    Posts
    51

    Smile 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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center