-
Notifications
You must be signed in to change notification settings - Fork 551
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
UDP "port unreachable" is not exposed #109
Comments
chrysn
added a commit
to chrysn/aiocoap
that referenced
this issue
Sep 15, 2017
Workaround-For: MagicStack/uvloop#109
1st1
added a commit
that referenced
this issue
Nov 24, 2017
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.
Should be fixed in master. Can you test if UDP works for you guys now? |
Please try uvloop v0.9.0, where this bug should be fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PYTHONASYNCIODEBUG
in env?: yesThe example from issue #108, when run as
./echo.py 0 127.0.0.1
(running an example from the Python documentation in asyncio, which opens a UDP socket to an unserviced port and sends data) reports an OSError 111 "Connection refused", while when run as./echo.py 1 127.0.0.1
(picking uvloop as the main loop), the network error is silently ignored.Please make uvloop call error_received with some exception in those situations.
(This was already hinted at in #108, but I opened it as a separate issue so its resolution can be tracked by the workarounds for this just entering the aiocoap test suite).
[edit: missed the platform field]
The text was updated successfully, but these errors were encountered: