template checkStreamClosed*(t: untyped) =
if t.state == AsyncStreamState.Closed: # "Finished" not handled
raiseAsyncStreamUseClosedError()
Since wstream.writerLoop is not nil, it's added to the wstream.queue, except that the tlsLoop was exited once we reach the Finished state so it will never be completed
when I use write on a TlsStream with state == Finished, the write hangs forever instead of popping an error: https://github.com/status-im/nim-chronos/blob/6525f4ce1d1a7eba146e5f1a53f6f105077ae686/chronos/streams/asyncstream.nim#L783-L789
Since
wstream.writerLoop
is not nil, it's added to thewstream.queue
, except that thetlsLoop
was exited once we reach theFinished
state so it will never be completedhttps://github.com/status-im/nim-chronos/blob/6525f4ce1d1a7eba146e5f1a53f6f105077ae686/chronos/streams/tlsstream.nim#L299-L301
EDIT: seems to be the same issue for state
Error