mirror of https://github.com/vacp2p/nim-libp2p.git
wip: rework with proper half-closed
This commit is contained in:
parent
98117a3068
commit
62da2a05c3
|
@ -77,6 +77,7 @@ proc newChannel*(id: uint64,
|
|||
result.msgCode = if initiator: MessageType.MsgOut else: MessageType.MsgIn
|
||||
result.closeCode = if initiator: MessageType.CloseOut else: MessageType.CloseIn
|
||||
result.resetCode = if initiator: MessageType.ResetOut else: MessageType.ResetIn
|
||||
result.writeLock = newAsyncLock()
|
||||
result.isLazy = lazy
|
||||
|
||||
let chan = result
|
||||
|
@ -177,7 +178,6 @@ method close*(s: LPChannel) {.async, gcsafe.} =
|
|||
s.closedLocal = true
|
||||
if s.atEof: # already closed by remote close parent buffer imediately
|
||||
await procCall BufferStream(s).close()
|
||||
|
||||
trace "lpchannel closed local", id = s.id,
|
||||
initiator = s.initiator,
|
||||
name = s.name,
|
||||
|
|
Loading…
Reference in New Issue