Re: Quetion about flags of socket.recv(bufsize, [flags])

2009-02-08 Thread Steve Holden
Ken wrote: > I want to receive 4 bytes from a connected socket, I code like this: > > data = sock.recv(4) > > There is a problem with above code. The recv method will not block until > it get all 4 bytes. So I use the second param of recv method like this > > data = sock.recv(4, socket.MSG_WAITA

Quetion about flags of socket.recv(bufsize, [flags])

2009-02-08 Thread Ken
I want to receive 4 bytes from a connected socket, I code like this: data = sock.recv(4) There is a problem with above code. The recv method will not block until it get all 4 bytes. So I use the second param of recv method like this data = sock.recv(4, socket.MSG_WAITALL) This works fine on lin