Ignore "Destination address required" error
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Dominik Heidler 2023-11-04 00:26:38 +01:00
parent 511d58e9c5
commit f8d414b4ae
1 changed files with 7 additions and 1 deletions

View File

@ -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)