title: python TCP socket blocks on recv method
body: <p>i am currently trying to go through a basic tutorial on networking and i noticed that a rudimentary client/server program would freeze upon the server trying to read more data from the client when all the data is received . Basically the code looks like this :</p>
  
  <pre><code>def recv_all(sock,length):
      data=''
      while len(data)&lt;length:
          more=sock.recv(length-len(data))
          if not more :
              raise EOFError('socket inchis %d octeti intr-un mesaj de %d octeti'%(len(data),length))
          data+=more
      return data
  </code></pre>
  
  <p>This function is called from both client and server but the server will use it first to process the client request. All goes fine until the second call to sock.recv , when the request message has been received. </p>
  
  <p>Instead of jumping to the next line (with more being 0) the debugger just freezes there and i have no idea what the reason for that might be.</p>
  
  <p>My OS is Windows XP if this is relevant in any way. Any help would be appreciated, 
                Thanks</p>