Skip to content

Commit

Permalink
Set default UDP associate remote when using RustUDPConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
egbertbouman committed Feb 20, 2024
1 parent fa1e883 commit c913c2f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,17 @@ def __init__(self, rust_endpoint, hops):
self.rust_endpoint = rust_endpoint
self.hops = hops
self.port = None
# Ensure this connection doesn't get picked up by the dispatcher
self.remote_udp_address = None
self.logger = logging.getLogger(self.__class__.__name__)

@property
def remote_udp_address(self) -> None:
# Ensure this connection doesn't get picked up by the dispatcher
return None

@remote_udp_address.setter
def remote_udp_address(self, address: tuple) -> None:
self.rust_endpoint.set_udp_associate_default_remote(address)

async def open(self):
if self.port is not None:
self.logger.error("UDP connection is already open on port %s", self.port)
Expand Down

0 comments on commit c913c2f

Please sign in to comment.