litex_server: set socket.SO_REUSEPORT to avoid waiting 60s in case of unclean termination
This commit is contained in:
parent
be99083e2b
commit
a2bc4bb777
|
@ -22,6 +22,7 @@ class RemoteServer(EtherboneIPC):
|
||||||
if hasattr(self, "socket"):
|
if hasattr(self, "socket"):
|
||||||
return
|
return
|
||||||
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
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))
|
self.socket.bind((self.bind_ip, self.bind_port))
|
||||||
print("tcp port: {:d}".format(self.bind_port))
|
print("tcp port: {:d}".format(self.bind_port))
|
||||||
self.socket.listen(1)
|
self.socket.listen(1)
|
||||||
|
|
Loading…
Reference in New Issue