properly close transport
This commit is contained in:
parent
a1ee339680
commit
f2fb92d1af
|
@ -47,11 +47,14 @@ method close*(t: TcpTransport): Future[void] {.async, gcsafe.} =
|
||||||
await procCall Transport(t).close() # call base
|
await procCall Transport(t).close() # call base
|
||||||
|
|
||||||
t.server.stop()
|
t.server.stop()
|
||||||
await t.server.closeWait()
|
t.server.close()
|
||||||
|
debug "transport stopped"
|
||||||
|
|
||||||
method listen*(t: TcpTransport,
|
method listen*(t: TcpTransport,
|
||||||
ma: MultiAddress,
|
ma: MultiAddress,
|
||||||
handler: ConnHandler):
|
handler: ConnHandler):
|
||||||
|
# TODO: need to check how this futures
|
||||||
|
# are being returned, it doesn't seem to be right
|
||||||
Future[Future[void]] {.async, gcsafe.} =
|
Future[Future[void]] {.async, gcsafe.} =
|
||||||
discard await procCall Transport(t).listen(ma, handler) # call base
|
discard await procCall Transport(t).listen(ma, handler) # call base
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue