Allow port reuse

This commit is contained in:
Luke Bonaccorsi 2023-08-24 16:35:26 +01:00
parent 7b26f4a22e
commit bba9febbb3
1 changed files with 2 additions and 2 deletions

View File

@ -20,10 +20,10 @@ class TuyaLocalDiscovery(asyncio.DatagramProtocol):
async def start(self):
loop = asyncio.get_running_loop()
listener = loop.create_datagram_endpoint(
lambda: self, local_addr=("0.0.0.0", 6666)
lambda: self, local_addr=("0.0.0.0", 6666), reuse_port=True
)
encrypted_listener = loop.create_datagram_endpoint(
lambda: self, local_addr=("0.0.0.0", 6667)
lambda: self, local_addr=("0.0.0.0", 6667), reuse_port=True
)
self._listeners = await asyncio.gather(listener, encrypted_listener)