Quetion about flags of socket.recv(bufsize, [flags])
Ken
xie.kenneth at gmail.com
Sun Feb 8 10:45:15 EST 2009
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 linux with python 2.5, while on windows, the interpreter
tells me 'AttributeError: 'module' object has no attribute 'MSG_WAITALL''.
How can I work this out, or there is another way to get certain bytes from a
socket and block if it hasn't got enough bytes?
:)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090208/159c47dc/attachment.html>
More information about the Python-list
mailing list