mirror of
https://github.com/status-im/nim-websock.git
synced 2025-01-11 18:14:10 +00:00
also in handleClose
This commit is contained in:
parent
a0ef79b127
commit
d01393774e
@ -264,6 +264,16 @@ proc handleClose*(
|
||||
await sleepAsync(10.millis)
|
||||
await ws.stream.closeWait()
|
||||
|
||||
if not isNil(ws.sendLoop):
|
||||
ws.sendLoop.cancel()
|
||||
# don't care about opcode,
|
||||
# but we can only have a single
|
||||
# `_` in 1.2
|
||||
for (_, opcode, fut) in ws.sendQueue:
|
||||
if not fut.finished:
|
||||
fut.fail(WSClosedError.newException("Session got closed"))
|
||||
ws.sendQueue.clear()
|
||||
|
||||
proc handleControl*(ws: WSSession, frame: Frame) {.async.} =
|
||||
## Handle control frames
|
||||
##
|
||||
|
Loading…
x
Reference in New Issue
Block a user