Set activity flag in WS (#721)

This commit is contained in:
Tanguy 2022-05-24 21:41:05 +02:00 committed by GitHub
parent d4ff1c88e9
commit 1696d0c707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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()