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 sbstp
Recipients gvanrossum, sbstp, vstinner, yselivanov
Date 2016-02-21.00:47:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456015662.7.0.00382711667437.issue26395@psf.upfronthosting.co.za>
In-reply-to
Content
I want to have a loop that receives data like this:

socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
socket.bind(('0.0.0.0', port))
socket.setblocking(False)
while True:
    data, addr = await loop.sock_recvfrom(sock, 4096)
    # process packet

It's pretty similar to what the blocking code would look like, but it allows me to keep everything on a single thread without blocking. It could be done with the Protocol API, but I'd rather use the shiny new async/await API.
History
Date User Action Args
2016-02-21 00:47:42sbstpsetrecipients: + sbstp, gvanrossum, vstinner, yselivanov
2016-02-21 00:47:42sbstpsetmessageid: <1456015662.7.0.00382711667437.issue26395@psf.upfronthosting.co.za>
2016-02-21 00:47:42sbstplinkissue26395 messages
2016-02-21 00:47:42sbstpcreate