mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-27 12:00:44 +00:00
exceptions and resource cleanup
This commit is contained in:
parent
ea2092580a
commit
04a802a995
@ -193,6 +193,9 @@ method reset*(s: LPChannel) {.base, async, gcsafe.} =
|
|||||||
# might be dead already - reset is always
|
# might be dead already - reset is always
|
||||||
# optimistic
|
# optimistic
|
||||||
asyncCheck s.resetMessage()
|
asyncCheck s.resetMessage()
|
||||||
|
# # because of the async check above,
|
||||||
|
# # give the message time to depart
|
||||||
|
# await sleepAsync(100.millis)
|
||||||
await procCall BufferStream(s).close()
|
await procCall BufferStream(s).close()
|
||||||
s.isEof = true
|
s.isEof = true
|
||||||
s.closedLocal = true
|
s.closedLocal = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user