]> Sergey Matveev's repositories - btrtrc.git/commit
Expose torrent Peer status updates (#987)
authorMarco Vidonis <31407403+marcovidonis@users.noreply.github.com>
Tue, 18 Mar 2025 23:29:32 +0000 (23:29 +0000)
committerGitHub <noreply@github.com>
Tue, 18 Mar 2025 23:29:32 +0000 (10:29 +1100)
commit3a656a26676c23ee845dcc5b810e1f7f06005b06
treee67488e43d30a161cc771c163375fb3826758070
parent4a278971a213ff177cf88d3691d99a0ba22a3225
Expose torrent Peer status updates (#987)

* handle connection to torrent peer status update messages

* basic observer framework
* connects to a valid tracker
* added observer channel for announce status
* set up Peer Connection status Observers
* add PeerConn test: connection established
* added Observers factory method
* Added Event to AnnounceStatus, with embedded TrackerStatus
* state updates must be non-blocking
* add unit tests on PeerConn Observer status reading
* add test and debug log on dropped connection
* add PeerID check to test

---------

Co-authored-by: Parker Whittle <pwhittle@medicom.us>
* do not support webtorrent/transport_test on wasm

* make AnnounceStatus InfoHash into a HexString

* replace MakeMapIfNilAndSet

* add StatusUpdated to callbacks

* replace Observers on Peer Conn status with callbacks

* replace tracker status updates with callbacks

* replace tracker announce status updates with callbacks

* remove references to observers

* test callbacks in client-peerconn_test

* add check that all callbacks were called in peer connection test

* test callbacks in client-tracker_test

---------

Co-authored-by: Parker Whittle <pwhittle@medicom.us>
callbacks.go
client-peerconn_test.go [new file with mode: 0644]
client-tracker_test.go [new file with mode: 0644]
client.go
peerconn.go
testing.go
torrent.go
webtorrent/tracker-client.go
webtorrent/transport_test.go
wstracker.go