Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/test_udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,30 @@ def connection_lost(self, exc):

self.assertIn(tmp_file2, pr.addrs)

def test_create_datagram_1(self):
server_addr = ('127.0.0.1', 8888)
client_addr = ('127.0.0.1', 0)

async def run():
server_transport, client_protocol = \
await self.loop.create_datagram_endpoint(
asyncio.DatagramProtocol,
local_addr=server_addr)

client_transport, client_conn = \
await self.loop.create_datagram_endpoint(
asyncio.DatagramProtocol,
remote_addr=server_addr,
local_addr=client_addr)

client_transport.close()
server_transport.close()

# let transports close
await asyncio.sleep(0.1)

self.loop.run_until_complete(run())


class Test_UV_UDP(_TestUDP, tb.UVTestCase):

Expand Down
2 changes: 0 additions & 2 deletions uvloop/loop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3040,8 +3040,6 @@ cdef class Loop:
'could not bind to remote_addr {}'.format(
remote_addr))

udp._connect(rai.ai_addr, rai.ai_addrlen)

if allow_broadcast:
udp._set_broadcast(1)

Expand Down