Skip to content

Commit e9db7fb

Browse files
authored
Add missing socket to deal correctly with unicast SSDP. (#43)
1 parent d4f99fb commit e9db7fb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

multicast-relay.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ def addListener(self, addr, port, service):
268268
# unicast -- we don't know yet which IP we'll want to send to
269269
self.etherAddrs[addr] = None
270270

271+
rx = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_UDP)
272+
rx.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
273+
rx.bind((addr, port))
274+
self.receivers.append(rx)
275+
271276
# Set up the receiving socket and corresponding IP and interface information.
272277
# One receiving socket is required per multicast address. But for extra
273278
# fun, one receiving socket for each network interface, if we're

0 commit comments

Comments
 (0)