Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, the <code>shutdown()</code> and <code>close()</code> calls in Boost.Asio call the underlying BSD socket implementation. So there is nothing "special" about Asio's shutdown() or close() calls.</p> <ul> <li><p><code>shutdown()</code> doesn't block. It is typically used to disable sends/receives or both (ie, send an EOF to the other end). It will NOT destroy the socket (i.e. the socket resource is NOT freed)</p></li> <li><p><code>close()</code> will free the socket resource. It may also block depending on the <code>SO_LINGER</code> option. But <code>SO_LINGER</code> is a tricky beast, to convince you: <a href="http://lists.freebsd.org/pipermail/freebsd-questions/2004-June/049093.html" rel="nofollow">http://lists.freebsd.org/pipermail/freebsd-questions/2004-June/049093.html</a> and <a href="http://developerweb.net/viewtopic.php?id=2982" rel="nofollow">http://developerweb.net/viewtopic.php?id=2982</a>. However, if you are using non-blocking sockets (i.e. O_NONBLOCK, which is what Boost.Asio is really wrapped up around), then close() doesn't block.</p></li> </ul> <p>Further reading: </p> <p><a href="http://linux.die.net/man/3/shutdown" rel="nofollow">http://linux.die.net/man/3/shutdown</a> <a href="http://linux.die.net/man/3/close" rel="nofollow">http://linux.die.net/man/3/close</a> </p> <p>And if you are Windows: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms738547%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ms738547%28v=vs.85%29.aspx</a> (read the comments, apparently the documented graceful shutdown techniques don't work all the time..)</p>
    singulars
    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