From f2fb92d1af623537714e8d666dc599f864407d3f Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Thu, 12 Sep 2019 18:56:32 -0600 Subject: [PATCH] properly close transport --- libp2p/transports/tcptransport.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libp2p/transports/tcptransport.nim b/libp2p/transports/tcptransport.nim index 1b6b9c7..06532c2 100644 --- a/libp2p/transports/tcptransport.nim +++ b/libp2p/transports/tcptransport.nim @@ -47,11 +47,14 @@ method close*(t: TcpTransport): Future[void] {.async, gcsafe.} = await procCall Transport(t).close() # call base t.server.stop() - await t.server.closeWait() + t.server.close() + debug "transport stopped" method listen*(t: TcpTransport, ma: MultiAddress, handler: ConnHandler): + # TODO: need to check how this futures + # are being returned, it doesn't seem to be right Future[Future[void]] {.async, gcsafe.} = discard await procCall Transport(t).listen(ma, handler) # call base