TcpTransport.listen(): enable SO_REUSEADDR

in order to avoid failures when restarting the process while the OS is
keeping open sockets from previous runs
This commit is contained in:
Ștefan Talpalaru 2020-05-01 15:18:02 +02:00 committed by Dmitriy Ryajov
parent 1efada474c
commit 125843af7d
1 changed files with 1 additions and 1 deletions

View File

@ -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