I've noticed that there's a few functions that return what appears to
be a tuple, but that also has attributes for each item in the tuple.
For example, time.localtime() returns a time.time_struct, which looks
like a tuple but also like a struct. That is, I can do:
>>> time.localtime()
(2006, 1, 1
I don't think this is true in all cases - for example, if the protocol
is UDP, and the packet size is less than the MTU size. Although, I
could be wrong - I've always thought that to be the case.
I knew someone would have your response, that's why I earlier said I
didn't want to argue that. :-)
Correction to my last post:
It should say:
"To your question of why you'd ever recv(0):"
--
http://mail.python.org/mailman/listinfo/python-list
Steve,
To your question of why you'd ever receive value:
This is very common in any network programming. If you send a packet
of data that has a header and payload, and the header contains the
length (N) of the payload, then at some point you have to receive N
bytes. If N is zero, then you rece
More simple way? What's that?
--
http://mail.python.org/mailman/listinfo/python-list
socket objects have a little quirk. If you try to receive 0 bytes on a
blocking socket, they block. That is, if I call recv(0), it blocks
(until some data arrives).
I think that's wrong, but I don't want to argue that. I would like to
create a subclass of socket that fixes the problem. Ideally