-
Notifications
You must be signed in to change notification settings - Fork 553
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 sendto not working #319
Comments
with uvloop 0.13.0 I have next error:
in same time with classic eventloop I have no any problems. |
ok, with version 0.12.2 everything working fine. |
after bisect I found this commit c2b65bc it's break UDP for aiosip (and I think not only). |
Thanks for reporting this. Could you please write a functional test that would exhibit the bug? |
@1st1 yes, please import asyncio
import uvloop
uvloop.install()
class UDP(asyncio.DatagramProtocol):
def __init__(self):
pass
def connection_lost(self, error):
print("connection_lost", error)
async def main():
loop = asyncio.get_event_loop()
transport, proto = await loop.create_datagram_endpoint(
lambda: UDP(),
local_addr=("192.168.1.9", 6001),
remote_addr=("192.168.1.3", 5060)
)
print("Before sending the message without a destination")
transport.sendto(b"deadbeef")
await asyncio.sleep(1)
print("After sending the message without a destination")
print("Before sending the message with a destination")
transport.sendto(b"deadbeef", ("192.168.1.3", 5060)) # will be connection lost
await asyncio.sleep(1)
print("After sending the message with a destination")
asyncio.get_event_loop().run_until_complete(main()) looks like it happens if you trying to send a message with destination address and you have already specified it in create_datagram_endpoint as remote_addr. Without uvloop all working perfectly. |
You cannot both "connect" the endpoint to a remote address and use This is the case in vanilla asyncio too: I wonder if uvloop is raising EDIT My bad if the same remote address is used for |
PYTHONASYNCIODEBUG
in env?: yesHello. Currently, I am trying to work with aiosip project and it's working very well but unfortunately, it stops working after installing uvloop.
It looks like sendto do nothing and without any error. I can't see any UDP packet on any device.
Probably I should go deeply with gdb.
PS datagram endpoint created fine and without exceptions https://github.com/stalkerg/aiosip/blob/master/aiosip/peers.py#L316
The text was updated successfully, but these errors were encountered: