title: Python socket recv function
body: <p>In the python socket module recv method <code>socket.recv(bufsize[, flags])</code> docs <a href="https://docs.python.org/3.6/library/socket.html#socket.socket.recv" rel="nofollow noreferrer">here</a> , it states:</p>
  <pre><code>Receive data from the socket. The return value is a bytes object representing the data received.
  The maximum amount of data to be received at once is specified by bufsize.
  </code></pre>
  <p>I'm aware that <code>bufsize</code> represents the MAX amount of data received at once, and that if the amount of data received is LESS than bufsize, that means that the number of bytes sent by socket on the other end is less than <code>bufsize</code></p>
  <p>Is it possible that the data returned from the 1st call to <code>socket.recv(bufsize)</code> is &lt; <code>bufsize</code> but there is still data left in the network buffer?</p>
  <p>Eg.</p>
  <pre class="lang-py prettyprint-override"><code>data = socket.recv(10)
  print(len(data))       # outputs 5
  data = socket.recv(10) # calling `socket.recv(10)` returns more data without the
                         # socket on the other side doing `socket.send(data)`
  </code></pre>
  <p>Can a scenario in the example ever occur and does this apply for unix domain sockets as well as regular TCP/IP sockets?</p>