ThreadingTCPServer: sock.recv() doesn't block?

Steve Holden steve at holdenweb.com
Wed Apr 2 11:59:53 EDT 2008


Prepscius, Colin (IT) wrote:
> So I'm using the ThreadingTCPServer from the python standard library 
> SocketServer, and calling serve_forever on it.  In my handler's handle 
> method, I call self.request.recv(x) in a loop until I've received n 
> bytes.  But recv() returns immediately with nothing, over and over.  It 
> all still works, but my cpu pegs.  I thought socketc.recv() was supposed 
> to block.  Anybody know if I'm doing something wrong?
>  
It would be easier to say if we could actually see the code for your 
handle() method - indeed, the whole server wouldn't hurt.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list