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.msgCode = if initiator: MessageType.MsgOut else: MessageType.MsgIn
|
||||||
result.closeCode = if initiator: MessageType.CloseOut else: MessageType.CloseIn
|
result.closeCode = if initiator: MessageType.CloseOut else: MessageType.CloseIn
|
||||||
result.resetCode = if initiator: MessageType.ResetOut else: MessageType.ResetIn
|
result.resetCode = if initiator: MessageType.ResetOut else: MessageType.ResetIn
|
||||||
|
result.writeLock = newAsyncLock()
|
||||||
result.isLazy = lazy
|
result.isLazy = lazy
|
||||||
|
|
||||||
let chan = result
|
let chan = result
|
||||||
|
@ -177,7 +178,6 @@ method close*(s: LPChannel) {.async, gcsafe.} =
|
||||||
s.closedLocal = true
|
s.closedLocal = true
|
||||||
if s.atEof: # already closed by remote close parent buffer imediately
|
if s.atEof: # already closed by remote close parent buffer imediately
|
||||||
await procCall BufferStream(s).close()
|
await procCall BufferStream(s).close()
|
||||||
|
|
||||||
trace "lpchannel closed local", id = s.id,
|
trace "lpchannel closed local", id = s.id,
|
||||||
initiator = s.initiator,
|
initiator = s.initiator,
|
||||||
name = s.name,
|
name = s.name,
|
||||||
|
|
Loading…
Reference in New Issue