Skip to content

Commit

Permalink
Set the SO_REUSEADDR option
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Indenbaum <[email protected]>
  • Loading branch information
Alexander Indenbaum committed Oct 7, 2023
1 parent 838b698 commit bd12ed7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions control/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,8 @@ def start_service(self):
"""Enable listening on the server side."""

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Set the SO_REUSEADDR option
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((self.discovery_addr, int(self.discovery_port)))
sock.listen(MAX_CONNECTION)
sock.setblocking(False)
Expand Down

0 comments on commit bd12ed7

Please sign in to comment.