func (t *Torrent) announceRequest(event tracker.AnnounceEvent) tracker.AnnounceRequest {
	// Note that IPAddress is not set. It's set for UDP inside the tracker
	// code, since it's dependent on the network in use.
	return tracker.AnnounceRequest{
		Event:    event,
		NumWant:  -1,
		Port:     uint16(t.cl.incomingPeerPort()),
		PeerId:   t.cl.peerID,
		InfoHash: t.infoHash,
		Key:      t.cl.announceKey(),

		// The following are vaguely described in BEP 3.

		Left:     t.bytesLeftAnnounce(),
		Uploaded: t.stats.BytesWrittenData.Int64(),
		// There's no mention of wasted or unwanted download in the BEP.
		Downloaded: t.stats.BytesReadUsefulData.Int64(),
	}
}
// Returns an AnnounceRequest with fields filled out to defaults and current
// values.
Returns an AnnounceRequest with fields filled out to defaults and current
values.
// Returns an AnnounceRequest with fields filled out to defaults and current // values .
func (t *Torrent) announceRequest(event tracker.AnnounceEvent) tracker.AnnounceRequest {
	return tracker.AnnounceRequest{
		Event:    event,
		NumWant:  -1,
		Port:     uint16(t.cl.incomingPeerPort()),
		PeerId:   t.cl.peerID,
		InfoHash: t.infoHash,
		Key:      t.cl.announceKey(),
		Left:     t.bytesLeftAnnounce(),
		Uploaded: t.stats.BytesWrittenData.Int64(),
		Downloaded: t.stats.BytesReadUsefulData.Int64(),
	}
}
func ( t * Torrent ) announceRequest ( event tracker . AnnounceEvent ) tracker . AnnounceRequest { return tracker . AnnounceRequest { Event : event , NumWant : - 1 , Port : uint16 ( t . cl . incomingPeerPort ( ) ) , PeerId : t . cl . peerID , InfoHash : t . infoHash , Key : t . cl . announceKey ( ) , Left : t . bytesLeftAnnounce ( ) , Uploaded : t . stats . BytesWrittenData . Int64 ( ) , Downloaded : t . stats . BytesReadUsefulData . Int64 ( ) , } }
Returns an AnnounceRequest with fields filled out to defaults and current
values.
Returns an AnnounceRequest with fields filled out to defaults and current values .
// Note that IPAddress is not set. It's set for UDP inside the tracker // code, since it's dependent on the network in use. // The following are vaguely described in BEP 3. // There's no mention of wasted or unwanted download in the BEP.