sock.recv() in Windows

Peter Hansen peter at engcorp.com
Sat Aug 21 22:07:20 EDT 2004


Jason wrote:
> Hi,
> 
> When using the socket module in Python 2.3 for windows, I'm having problems
> using socket.recv(int).  The function works fine on its own, but when I
> attempt to encapsulate the socket functions into a class method, my script
> just hangs with the Python DOS window open.
> 
> My class method is simple:
> 
> def getData(self, max_size=1024):
>     return self.sock.recv(max_size)
> 
> Why would an instance of this class cause python to hang in windows?  

Define "hang".  You do realize that socket.recv() is blocking
by default, and will "hang" until data arrives, don't you?

I don't think you've given nearly enough info for anyone to
do more than guess wildly here...

-Peter



More information about the Python-list mailing list