Skip to content

Commit

Permalink
Binding to local address for unicast
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-summers committed Oct 12, 2023
1 parent 3f246f8 commit ae66208
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py/stabilizer/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ async def open(cls, addr, port, broker, maxsize=1):
group = socket.inet_aton(addr)
iface = socket.inet_aton('.'.join([str(x) for x in get_local_ip(broker)]))
sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, group + iface)

sock.bind(('', port))
sock.bind(('', port))
else:
sock.bind((addr, port))

transport, protocol = await loop.create_datagram_endpoint(lambda: cls(maxsize), sock=sock)
return transport, protocol
Expand Down

0 comments on commit ae66208

Please sign in to comment.