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.

classification
Title: socket.recvfrom(0) waits for data
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Sworddragon, benjamin.peterson
Priority: normal Keywords:

Created on 2015-01-06 02:58 by Sworddragon, last changed 2022-04-11 14:58 by admin.

Messages (3)
msg233500 - (view) Author: (Sworddragon) Date: 2015-01-06 02:58
For example on sending ICMP packets and receiving the data socket.recv(1) does wait for data while socket.recv(0) doesn't. socket.recvfrom(1) does wait for data too but I'm also seeing that socket.recvfrom(0) is waiting for data which doesn't look correct (at least it seems not to be consistent with socket.recv()).
msg233502 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2015-01-06 03:49
That's not surprising, since revcfrom uses select() on the socket regardless of the value its argument. I'm not sure what the use of calling revcfrom(0) is.
msg233503 - (view) Author: (Sworddragon) Date: 2015-01-06 04:13
If there is no real use for socket.recvfrom(0) (and then probably socket.recv(0) too) maybe a bufsize argument of 0 should throw an exception?
History
Date User Action Args
2022-04-11 14:58:11adminsetgithub: 67365
2015-01-06 04:13:22Sworddragonsetmessages: + msg233503
2015-01-06 03:49:15benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg233502
2015-01-06 02:58:37Sworddragoncreate