]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Tracker doc
authorMatt Joiner <anacrolix@gmail.com>
Mon, 16 Dec 2013 07:46:55 +0000 (18:46 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 16 Dec 2013 07:46:55 +0000 (18:46 +1100)
tracker/tracker.go

index 5ce7500c3da0ed1f564414d6a09e395142190620..701bacc04051adadc59ff5f681137815ef75040a 100644 (file)
@@ -15,12 +15,12 @@ type AnnounceRequest struct {
        Event      AnnounceEvent
        IPAddress  int32
        Key        int32
-       NumWant    int32
+       NumWant    int32 // How many peer addresses are desired. -1 for default.
        Port       int16
 }
 
 type AnnounceResponse struct {
-       Interval int32
+       Interval int32 // Minimum seconds the local peer should wait before next announce.
        Leechers int32
        Seeders  int32
        Peers    []Peer
@@ -34,13 +34,14 @@ type Peer struct {
 }
 
 const (
-       None AnnounceEvent = iota
-       Completed
-       Started
-       Stopped
+       None      AnnounceEvent = iota
+       Completed               // The local peer just completed the torrent.
+       Started                 // The local peer has just resumed this torrent.
+       Stopped                 // The local peer is leaving the swarm.
 )
 
 type Client interface {
+       // Returns ErrNotConnected if Connect needs to be called.
        Announce(*AnnounceRequest) (AnnounceResponse, error)
        Connect() error
 }