Skip to content

Commit

Permalink
Merge pull request #17 from TheWizz/master
Browse files Browse the repository at this point in the history
Must set SO_REUSEADDR before binding socket.
  • Loading branch information
BryanCrotaz authored Mar 31, 2023
2 parents 216e8b3 + d501599 commit 94d3103
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/artnet_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94d3103

Please sign in to comment.