Message221164
> 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. |
|
Date |
User |
Action |
Args |
2014-06-21 10:08:56 | neologix | set | recipients:
+ neologix, Sworddragon |
2014-06-21 10:08:56 | neologix | set | messageid: <1403345336.49.0.793431288638.issue21819@psf.upfronthosting.co.za> |
2014-06-21 10:08:56 | neologix | link | issue21819 messages |
2014-06-21 10:08:56 | neologix | create | |
|