From: Florent Kermarrec Date: Mon, 15 Apr 2019 06:23:27 +0000 (+0200) Subject: litex_server: set socket.SO_REUSEPORT to avoid waiting 60s in case of unclean termination X-Git-Tag: 24jan2021_ls180~1333^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2bc4bb777dc19a4f6e9b67605834c0bc5904a3e;p=litex.git litex_server: set socket.SO_REUSEPORT to avoid waiting 60s in case of unclean termination --- diff --git a/litex/utils/litex_server.py b/litex/utils/litex_server.py index b5dcb8f3..f8c6b116 100755 --- a/litex/utils/litex_server.py +++ b/litex/utils/litex_server.py @@ -22,6 +22,7 @@ class RemoteServer(EtherboneIPC): if hasattr(self, "socket"): return self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) self.socket.bind((self.bind_ip, self.bind_port)) print("tcp port: {:d}".format(self.bind_port)) self.socket.listen(1)