title: Can read() function on a connected socket return zero bytes?
body: <p>I know that read() is a blocking call unless I make the socket non-blocking. So I expect read() call which requests 4K of data should return a positive value ( no of bytes read) or -1 on error ( possible connection reset by client etc). My question is: Can read() return '0' on any occasion? </p>
  
  <p>I am handling the read() this way:</p>
  
  <pre><code>   if ((readval = read(acceptfd, buf, sizeof(buf) - 1)) &lt; 0)
      {
  
      }
      else
      {
         buf[readval] = 0;
         //Do some thing with data  
      }
  </code></pre>
  
  <p>This code bombs if read() return zero and I know how to fix it. But is it possible for read() to return zero?</p>