Skip to content

Commit f6c32b6

Browse files
committed
Add stubs for new 3.11 loop.sock_*() methods
1 parent 46e38c2 commit f6c32b6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Diff for: uvloop/loop.pyi

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import ssl
3+
import sys
34
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
45
from typing import (
56
IO,
@@ -210,6 +211,9 @@ class Loop:
210211
async def sock_sendall(self, sock: socket, data: bytes) -> None: ...
211212
async def sock_accept(self, sock: socket) -> Tuple[socket, _RetAddress]: ...
212213
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
214+
async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ...
215+
async def sock_recvfrom_into(self, sock: socket, buf: bytearray, nbytes: int = ...) -> int: ...
216+
async def sock_sendto(self, sock: socket, data: bytes, address: _Address) -> None: ...
213217
async def connect_accepted_socket(
214218
self,
215219
protocol_factory: Callable[[], _ProtocolT],

Diff for: uvloop/loop.pyx

+12
Original file line numberDiff line numberDiff line change
@@ -2617,6 +2617,18 @@ cdef class Loop:
26172617
finally:
26182618
socket_dec_io_ref(sock)
26192619

2620+
@cython.iterable_coroutine
2621+
async def sock_recvfrom(self, sock, bufsize):
2622+
raise NotImplementedError
2623+
2624+
@cython.iterable_coroutine
2625+
async def sock_recvfrom_into(self, sock, buf, nbytes=0):
2626+
raise NotImplementedError
2627+
2628+
@cython.iterable_coroutine
2629+
async def sock_sendto(self, sock, data, address):
2630+
raise NotImplementedError
2631+
26202632
@cython.iterable_coroutine
26212633
async def connect_accepted_socket(self, protocol_factory, sock, *,
26222634
ssl=None,

0 commit comments

Comments
 (0)