title: How to check if socket is closed in Boost.Asio?
body: <p>What is the easiest way to check if a socket was closed on the remote side of the connection? <code>socket::is_open()</code> returns true even if it is closed on the remote side (I'm using <code>boost::asio::ip::tcp::socket</code>).</p>
  
  <p>I could try to read from the stream and see if it succeeds, but I'd have to change the logic of my program to make it work this way (I do not want data to be extracted from the stream at the point of the check).</p>