This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients Sworddragon, neologix
Date 2014-06-21.10:08:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403345336.49.0.793431288638.issue21819@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2014-06-21 10:08:56neologixsetrecipients: + neologix, Sworddragon
2014-06-21 10:08:56neologixsetmessageid: <1403345336.49.0.793431288638.issue21819@psf.upfronthosting.co.za>
2014-06-21 10:08:56neologixlinkissue21819 messages
2014-06-21 10:08:56neologixcreate