From d501599d92eb5c825923c29b9f1a095e226dab0d Mon Sep 17 00:00:00 2001 From: Mike Fahl Date: Mon, 24 Oct 2022 17:02:38 +0200 Subject: [PATCH] Must set SO_REUSEADDR before binding socket. --- src/artnet_socket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/artnet_socket.py b/src/artnet_socket.py index 8bf1ffd..2239923 100644 --- a/src/artnet_socket.py +++ b/src/artnet_socket.py @@ -25,8 +25,8 @@ def connect(self): """Connect to Artnet UDP socket""" try: self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP - self._socket.bind((UDP_IP, UDP_PORT)) self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + self._socket.bind((UDP_IP, UDP_PORT)) # blocking socket as we're listening in a background thread self._socket.setblocking(1) self._socket.settimeout(1) # 1 second timeout