Charles-François Natali added the comment:

> If I'm receiving data from a socket (several bytes) and making the
> first call to socket.recv(1) all is fine but the second call won't get
> any further data. But doing this again with socket.recv(2) instead will
> successfully get the 2 bytes. Here is a testcase:

First, note that Python just calles the underlying recv() syscall, so it's not 
at fault here.

And actually, noone's at fault here, because what you're trying to do doesn't 
make sense: ICMP is datagram-oriented, so you should use recvfrom(): and if you 
try to receive less bytes than the datagram size, the rest will be discarded, 
like UDP.

----------
nosy: +neologix
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21819>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to