Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the VxWorks "Library Reference" manual (can be download):</p> <p><strong>OPTIONS FOR STREAM SOCKETS</strong></p> <p>The following sections discuss the socket options available for stream (TCP) sockets.</p> <p><strong>SO_KEEPALIVE</strong> -- Detecting a Dead Connection</p> <p>Specify the SO_KEEPALIVE option to make the transport protocol (TCP) initiate a timer to detect a dead connection:</p> <pre><code> setsockopt (sock, SOL_SOCKET, SO_KEEPALIVE, &amp;optval, sizeof (optval)); </code></pre> <p>This prevents an application from hanging on an invalid connection. The value at optval for this option is an integer (type int), either 1 (on) or 0 (off). The integrity of a connection is verified by transmitting zero-length TCP segments triggered by a timer, to force a response from a peer node. If the peer does not respond after repeated transmissions of the <strong>KEEPALIVE</strong> segments, the connection is dropped, all protocol data structures are reclaimed, and processes sleeping on the connection are awakened with an <strong>ETIMEDOUT</strong> error.</p> <p>The <strong>ETIMEDOUT</strong> timeout can happen in two ways. If the connection is not yet established, the <strong>KEEPALIVE</strong> timer expires after idling for <strong>TCPTV_KEEP_INIT</strong>. If the connection is established, the KEEPALIVE timer starts up when there is no traffic for <strong>TCPTV_KEEP_IDLE</strong>. If no response is received from the peer after sending the <strong>KEEPALIVE</strong> segment <strong>TCPTV_KEEPCNT</strong> times with interval <strong>TCPTV_KEEPINTVL</strong>, TCP assumes that the connection is invalid. The parameters <strong>TCPTV_KEEP_INIT</strong>, <strong>TCPTV_KEEP_IDLE</strong>, <strong>TCPTV_KEEPCNT</strong>, and <strong>TCPTV_KEEPINTVL</strong> are defined in the file target/h/net/tcp_timer.h.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload