close connection on chronos close
This commit is contained in:
parent
46daed9a38
commit
5158d96eaf
|
@ -16,6 +16,12 @@ logScope:
|
|||
type ChronosStream* = ref object of LPStream
|
||||
client: StreamTransport
|
||||
|
||||
proc onTransportClose(s: ChronosStream,
|
||||
client: StreamTransport) {.async.} =
|
||||
await client.join()
|
||||
trace "Transport closed, closing connection"
|
||||
await s.close()
|
||||
|
||||
proc newChronosStream*(client: StreamTransport): ChronosStream =
|
||||
new result
|
||||
result.client = client
|
||||
|
|
Loading…
Reference in New Issue