TCP keep-alives are one of the most misunderstood features of TCP and also a rather poorly named one. A TCP connection will remain open forever if no packets ever show up to tear it down. I often see plans for turning on TCP keep-alives and they are almost always based on flawed motivations.

I can see turning on TCP keep-alives for an often-silent connection that goes through a firewall where the firewall has a configured time-out beyond which long-silent TCP connections are dropped from its table of open connections.

TCP keep-alives are certainly not particularly useful in keeping a TCP connection alive (except for the case of unusual situations with firewalls, as above). To repeat, a TCP connection can remain valid forever with no packets being exchanged at all. It requires a packet to tell a TCP connection to tear down.

Keep-alives are also usually not of much help in noticing that a TCP connection is no longer alive. For that to work you'd need to configure one side to send keep-alives and the other side to detect that keep-alives have ceased. I know the first part of that can be configured but I've not seen an option for the latter, thus keep-alives aren't useful for detecting an otherwise-silent break in a connection.

So, it is unclear whether suspending a process would suspend the sending of keep-alives for its connections (it might, or the sending might be handled by part of the network stack separate from the process and so suspending the process might have no impact). But a stop in the flow of keep-alives is unlikely to be noticed by the other side of the connection. So I'm not surprised that you didn't see connections being torn down.

- tye        


In reply to Re: SIGSTOP & TCP Heartbeat (misnamed) by tye
in thread SIGSTOP & TCP Heartbeat by needperlhelp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.