Set activity flag in WS (#721)
This commit is contained in:
parent
d4ff1c88e9
commit
1696d0c707
|
@ -71,12 +71,14 @@ method readOnce*(
|
||||||
|
|
||||||
if res == 0 and s.session.readyState == ReadyState.Closed:
|
if res == 0 and s.session.readyState == ReadyState.Closed:
|
||||||
raise newLPStreamEOFError()
|
raise newLPStreamEOFError()
|
||||||
|
s.activity = true # reset activity flag
|
||||||
return res
|
return res
|
||||||
|
|
||||||
method write*(
|
method write*(
|
||||||
s: WsStream,
|
s: WsStream,
|
||||||
msg: seq[byte]): Future[void] {.async.} =
|
msg: seq[byte]): Future[void] {.async.} =
|
||||||
mapExceptions(await s.session.send(msg, Opcode.Binary))
|
mapExceptions(await s.session.send(msg, Opcode.Binary))
|
||||||
|
s.activity = true # reset activity flag
|
||||||
|
|
||||||
method closeImpl*(s: WsStream): Future[void] {.async.} =
|
method closeImpl*(s: WsStream): Future[void] {.async.} =
|
||||||
await s.session.close()
|
await s.session.close()
|
||||||
|
|
Loading…
Reference in New Issue