Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the client program exits, then the OS on the client will close its end of the socket. When you call <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/recv.html" rel="noreferrer"><code>recv()</code></a> it will return 0, or -1 with errno <code>ECONNRESET</code> if a TCP RST has been received (e.g. because you attempted to send data after the client had closed). If the whole client machine goes down, or the network becomes disconnected, then in that case you may not receive anything if the server is not trying to send anything; if that is important to detect, you can either send some data periodically, or set the <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_10_16" rel="noreferrer"><code>SO_KEEPALIVE</code></a> socket option using <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html" rel="noreferrer"><code>setsockopt()</code></a> to force it to send a packet with no data after long periods (hours) of inactivity. When no acknowledgment is received, <code>recv()</code> will then return -1 with errno <code>ETIMEDOUT</code> or another error if more specific information is available.</p> <p>In addition, if you attempt to send data on a socket that has been disconnected, by default the SIGPIPE signal will terminate your program. This can be avoided by setting the SIGPIPE signal action to SIG_IGN (ignore), or by using <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/send.html" rel="noreferrer"><code>send()</code></a> with the <code>MSG_NOSIGNAL</code> flag on systems that support it (Linux).</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. 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.
    3. 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