Ignore "Destination address required" error
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
511d58e9c5
commit
f8d414b4ae
1 changed files with 7 additions and 1 deletions
|
@ -30,7 +30,13 @@ while True:
|
||||||
print(f"{UDP_IP}:{UDP_PORT} {MESSAGE=}" % MESSAGE)
|
print(f"{UDP_IP}:{UDP_PORT} {MESSAGE=}" % MESSAGE)
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
||||||
sock.bind(('0.0.0.0', 1900)) # 1900 is SSDP src port
|
sock.bind(('0.0.0.0', 1900)) # 1900 is SSDP src port
|
||||||
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
|
try:
|
||||||
|
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
|
||||||
|
except OSError:
|
||||||
|
# OSError: [Errno 89] Destination address required
|
||||||
|
# this error means that wireguard doesn't know an endpoint for this peer
|
||||||
|
# so we can ignore this error
|
||||||
|
pass
|
||||||
sock.close()
|
sock.close()
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue