From 125843af7d8b98ca088368c1c92436cb1a5150c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Fri, 1 May 2020 15:18:02 +0200 Subject: [PATCH] TcpTransport.listen(): enable SO_REUSEADDR in order to avoid failures when restarting the process while the OS is keeping open sockets from previous runs --- libp2p/transports/tcptransport.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/transports/tcptransport.nim b/libp2p/transports/tcptransport.nim index 49d8f88b3..321b74b98 100644 --- a/libp2p/transports/tcptransport.nim +++ b/libp2p/transports/tcptransport.nim @@ -127,7 +127,7 @@ method listen*(t: TcpTransport, discard await procCall Transport(t).listen(ma, handler) # call base ## listen on the transport - t.server = createStreamServer(t.ma, connCb, {}, t) + t.server = createStreamServer(t.ma, connCb, {ReuseAddr}, t) t.server.start() # always get the resolved address in case we're bound to 0.0.0.0:0