title: When does socket.recv(recv_size) return?
body: <p>From test, I concluded that in following three cases the <code>socket.recv(recv_size)</code> will return.</p>
  
  <ol>
  <li><p>After the connection was closed. For example, the client side
  called socket.close() or any socket error occurred, it would return
  empty string.</p></li>
  <li><p>Some data come, the size of data is more than <code>recv_size</code>.</p></li>
  <li>Some data come, the size of data is less than <code>recv_size</code> and no more data come after a short time (I found 0.1s would work).</li>
  </ol>
  
  <p>More details about #3:</p>
  
  <pre><code>#server.py
  
  while True:
      data = sock.recv(10)
      print data, 'EOF'
  
  #client1.py
  
  sock.sendall("12345")
  sock.sendall("a" * 50)
  
  #client2.py
  
  sock.sendall("12345")
  time.sleep(0.1)
  sock.sendall("a" * 50)
  </code></pre>
  
  <p>When I run <code>client1.py</code>, the <code>server.py</code> echos:</p>
  
  <pre><code>12345aaaaa EOF
  aaaaaaaaaa EOF
  aaaaaaaaaa EOF
  aaaaaaaaaa EOF
  aaaaaaaaaa EOF
  aaaaa EOF
  </code></pre>
  
  <p>When I run <code>client2.py</code>, the <code>server.py</code> echos:</p>
  
  <pre><code>12345 EOF
  aaaaaaaaaa EOF
  aaaaaaaaaa EOF
  aaaaaaaaaa EOF
  aaaaaaaaaa EOF
  aaaaaaaaaa EOF
  </code></pre>
  
  <p>Are my conclusions correct? Where can I see the official description about #3?</p>