Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for loop.sock_sendto #561

Open
difeid opened this issue Sep 6, 2023 · 0 comments
Open

Add support for loop.sock_sendto #561

difeid opened this issue Sep 6, 2023 · 0 comments

Comments

@difeid
Copy link

difeid commented Sep 6, 2023

  • uvloop version: 0.17.0
  • Python version: 3.11.4
  • Platform: Linux
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Not a bug
  • Does uvloop behave differently from vanilla asyncio? How?: Yes, not implemented feature

The uvloop not implement method sock_sendto.

coroutine loop.sock_sendto(sock, data, address)
Send a datagram from sock to address. Asynchronous version of socket.sendto()

Return the number of bytes sent.
sock must be a non-blocking socket.
New in version 3.11.

The simple test case that reproduces the problem:

#!/usr/bin/env python3

import socket
import asyncio
import uvloop

uvloop.install()

addr = ("127.0.0.1", 1111)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setblocking(False)

loop = asyncio.get_event_loop()
loop.run_until_complete(loop.sock_sendto(s, b'test', addr))

uvloop == 0.17.0 response:

Traceback (most recent call last):
  File "/home/danil/test_async_sock.py", line 16, in <module>
    loop.run_until_complete(loop.sock_sendto(s, b'test', addr))
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "uvloop/loop.pyx", line 2629, in sock_sendto
  NotImplementedError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant