You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new implementation follows asyncio pretty closely. We no longer use
uv_udp_* functions from libuv. Instead, we use uv_poll_* and inherit
asyncio logic from selector_events.py.
When `loop.create_datagram_endpoint()` is called with a `remote_addr`
argument, asyncio attempts to *connect* the socket. The old uvloop
implementation didn't do that, as there's no 'uv_udp_connect()' function
in libuv (at least yet).
For UDP it doesn't really matter if the socket is connected or not. The
main difference is that when a UDP socket is connected, we can use
`socket.send(data)` method, instead of `socket.sendto(data, addr)`.
The subtle difference appears in two scenarios:
* using getsockname();
* raising an exception from `create_datagram_endpoint()` when
`remote_addr` is unreachable.
It doesn't seem practical to wait until we have `uv_udp_connect()`
function in libuv, hence the rewrite.
In the future, when `uv_udp_connect()` is available, it should be easy
to rollback to the current implementation.
Addresses issues #109, #108, #85.
0 commit comments