]> Sergey Matveev's repositories - btrtrc.git/commit
Ping websocket to ensure connect remains online.
authorJustin M <37273682+DigitalAlchemist@users.noreply.github.com>
Tue, 5 Jan 2021 05:40:44 +0000 (05:40 +0000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 6 Jan 2021 03:30:01 +0000 (14:30 +1100)
commitf33b3ba5ce5d1c660c2b2995609405fbb15775c8
tree114825521a19666d7faa353ac383510b83b87c48
parentded6c19edbe1c5382dafc09c178c7d3ce111a84f
Ping websocket to ensure connect remains online.

OpenWebTorrent disconnects clients after two minutes of inactivity. In a scenario where an
announce occurs and no other activity occurs for the (default) 120-second idle timer, the
websocket will be torn down by OpenWebTorrent. This in turn causes the tracker client to wait one
minute, reconnect, and reannounce its peers.

This patch sends a websocket.PingMessage every 60 seconds to maintain the connection.
webtorrent/tracker_client.go