summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/proactor_events.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2022-03-13 16:42:29 (GMT)
committerGitHub <noreply@github.com>2022-03-13 16:42:29 (GMT)
commit9f04ee569cebb8b4c6f04bea95d91a19c5403806 (patch)
treeabd4626ee19d394f35109b4cd2830d50a4a4f9d9 /Lib/asyncio/proactor_events.py
parent7e473e94a52024ac821dd2f206290423e4987ead (diff)
downloadcpython-9f04ee569cebb8b4c6f04bea95d91a19c5403806.zip
cpython-9f04ee569cebb8b4c6f04bea95d91a19c5403806.tar.gz
cpython-9f04ee569cebb8b4c6f04bea95d91a19c5403806.tar.bz2
bpo-46805: Add low level UDP socket functions to asyncio (GH-31455)
Diffstat (limited to 'Lib/asyncio/proactor_events.py')
-rw-r--r--Lib/asyncio/proactor_events.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
index 43d5e70..087f095 100644
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -700,9 +700,21 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
async def sock_recv_into(self, sock, buf):
return await self._proactor.recv_into(sock, buf)
+ async def sock_recvfrom(self, sock, bufsize):
+ return await self._proactor.recvfrom(sock, bufsize)
+
+ async def sock_recvfrom_into(self, sock, buf, nbytes=0):
+ if not nbytes:
+ nbytes = len(buf)
+
+ return await self._proactor.recvfrom_into(sock, buf, nbytes)
+
async def sock_sendall(self, sock, data):
return await self._proactor.send(sock, data)
+ async def sock_sendto(self, sock, data, address):
+ return await self._proactor.sendto(sock, data, 0, address)
+
async def sock_connect(self, sock, address):
return await self._proactor.connect(sock, address)