title: What is the condition for completion handler of basic_stream_socket::async_write_some to be called?
body: <p><a href="https://www.boost.org/doc/libs/1_73_0/doc/html/boost_asio/reference/basic_stream_socket/async_write_some.html" rel="nofollow noreferrer">The documentation</a> for <code>basic_stream_socket::async_write_some</code> states, that the completion handler is called &quot;when the write operation completes&quot;. But what exactly does that mean? I can think at least of two things</p>
  <ul>
  <li>when the kernel (networking stack in particular) takes responsibility for the data</li>
  <li>when the networking stack on the remote end has acknowledged (as in TCP ACK) the data, that was sent and the acknowledgement has reached the local networking stack</li>
  </ul>