mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 15:47:46 +00:00
[srp-server] retry other ports when failing to prepareSocket (#9981)
Unicast SRP dataset uses a ephemeral UDP port which could be taken by another process. Currently SRP server creates the socket at the port after the server is added into netdata. However, at that moment the port may not be available on the platform so it may fail to create the socket and start the server. This commit adds the logic to restart the enabling process with another port candidate if SRP server fails to create the socket.
This commit is contained in:
@@ -197,6 +197,9 @@ class OtbrDocker:
|
||||
self.pexpect.wait()
|
||||
self.pexpect.proc.kill()
|
||||
|
||||
def reserve_udp_port(self, port):
|
||||
self.bash(f'socat -u UDP6-LISTEN:{port},bindtodevice=wpan0 - &')
|
||||
|
||||
def destroy(self):
|
||||
logging.info("Destroying %s", self)
|
||||
self._shutdown_docker()
|
||||
|
||||
Reference in New Issue
Block a user