Skip to content

Commit

Permalink
Update receiver_socket_udp.py
Browse files Browse the repository at this point in the history
Proposed fix for Hundemeier#47 - allowing for differences between Windows and Linux.

Noting that I'm not clear that the Windows implementation is needed; but I don't have the ability to test that.
  • Loading branch information
andrewyager authored Jun 13, 2024
1 parent 1bc53ab commit cf34b61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sacn/receiving/receiver_socket_udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import socket
import threading
import time
import platform
from sacn.receiving.receiver_socket_base import ReceiverSocketBase, ReceiverSocketListener

THREAD_NAME = 'sACN input/receiver thread'
Expand All @@ -26,7 +27,11 @@ def __init__(self, listener: ReceiverSocketListener, bind_address: str, bind_por
self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
except socket.error: # Not all systems support multiple sockets on the same port and interface
pass
self._socket.bind((self._bind_address, self._bind_port))
os_name = platform.system()
if os_name == "Linux":
self._socket.bind(("", self._bind_port))
else:
self._socket.bind((self._bind_address, self._bind_port))
self._logger.info(f'Bind receiver socket to IP: {self._bind_address} port: {self._bind_port}')

def start(self):
Expand Down

0 comments on commit cf34b61

Please sign in to comment.