Linux socket- they disconnected or we did?
<p>I am receiving bytes through <code>::recv()</code> and have a scenario where it returns zero. According to here:</p>

<p><a href="http://www.tutorialspoint.com/unix_system_calls/recv.htm" rel="nofollow">http://www.tutorialspoint.com/unix_system_calls/recv.htm</a></p>

<p>this means:</p>

<blockquote>
  <p>The return value will be 0 when the peer has performed an orderly
  shutdown.</p>
</blockquote>

<p>Is there any way to find out which side of the connection closed it? I do not know whether the remote client killed our connection, or some logic on our side closed it.</p>