Tracker class abstract

An abstract class for accessing Announce to obtain data.

Implementers

Constructors

Tracker(String id, Uri announceUrl, Uint8List infoHashBuffer, {AnnounceOptionsProvider? provider})
maxRetryTime is the max retry times if connect timeout,default is 3

Properties

announceScrape int
The interval for looping scrape data, in seconds, defaults to 1 minute
getter/setter pair
announceUrl Uri
server url;
final
defaultIntervalTime int
The interval for looping through the announce url, in seconds, the default value is 30 minutes
final
events → EventsEmitter<TrackerEvent>
finalinherited
hashCode int
The hash code for this object.
no setteroverride
id String
Tracker ID , usually use server host url to be its id.
final
infoHash String
Torrent file info hash string
no setter
infoHashBuffer Uint8List
Torrent file info hash bytebuffer
final
isDisposed bool
no setter
isRunning bool
no setter
provider AnnounceOptionsProvider?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

announce(String eventType, Map<String, dynamic> options) Future<PeerEvent?>
Visit the announce URL for data. Call the method to initiate a visit to the Announce URL, it returns a Future. If successful, it will return the data as expected. However, if any failures occur during the process, such as decoding errors or timeouts, exceptions will be thrown. The parameter eventType must be one of started, stopped, completed, and can be null. The returned data should be a PeerEvent object. If the 'interval' property of this object is not empty and is different from the current loop interval time, the Tracker will stop the current Timer and create a new Timer with the interval time set to the value from the returned object's 'interval'.
close() Future
complete() Future<PeerEvent?>
When the download is complete, you need to call this method to notify announce. This method calls announce once, and the parameter bit is completed.
createListener({bool synchronized = false}) → EventsListener<TrackerEvent>
inherited
dispose([dynamic reason]) Future
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restart() Future<bool>
Restart the loop to initiate the announce visit.
start() Future<bool>
Start a loop to initiate an announce visit.
stop([bool force = false]) Future<PeerEvent?>
When abruptly stopped, this method needs to be called to notify 'announce' The method calls 'announce' once with the parameter bit 'stopped'. force is to force off the identity, with a default value of 'false'. If 'true', the method will not call the 'announce' method Send a 'stopped' request and return a 'null' directly.
stopIntervalAnnounce() → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override