Skip to content

Commit

Permalink
Set activity flag in WS (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
Menduist committed May 24, 2022
1 parent d4ff1c8 commit 1696d0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libp2p/transports/wstransport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ method readOnce*(

if res == 0 and s.session.readyState == ReadyState.Closed:
raise newLPStreamEOFError()
s.activity = true # reset activity flag
return res

method write*(
s: WsStream,
msg: seq[byte]): Future[void] {.async.} =
mapExceptions(await s.session.send(msg, Opcode.Binary))
s.activity = true # reset activity flag

method closeImpl*(s: WsStream): Future[void] {.async.} =
await s.session.close()
Expand Down

0 comments on commit 1696d0c

Please sign in to comment.