UDPTracker class

UDP Tracker

Inheritance

Constructors

UDPTracker.new(Uri _uri, Uint8List infoHashBuffer, {AnnounceOptionsProvider? provider})

Properties

addresses Future<List<CompactAddress>?>
Remote URL
no setter
announceScrape int
The interval for looping scrape data, in seconds, defaults to 1 minute
getter/setter pairinherited
announceUrl Uri
server url;
finalinherited
currentEvent String?
no setter
defaultIntervalTime int
The interval for looping through the announce url, in seconds, the default value is 30 minutes
finalinherited
events → EventsEmitter<TrackerEvent>
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id String
Tracker ID , usually use server host url to be its id.
finalinherited
infoHash String
Torrent file info hash string
no setterinherited
infoHashBuffer Uint8List
Torrent file info hash bytebuffer
finalinherited
isClosed bool
no setterinherited
isDisposed bool
no setterinherited
isRunning bool
no setterinherited
maxConnectRetryTimes int
getter/setter pairinherited
provider AnnounceOptionsProvider?
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transcationId List<int>?
Obtain the current transcation ID, and return it if there is, indicating that the current communication has not ended. If not, regenerate
no setterinherited
transcationIdNum int
Convert the trancation ID to a number
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'.
override
close() Future<void>
Close the connection and clear settings
inherited
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.
override
contactAnnouncer<T>(Map options) Future<T?>
An entry function that communicates with Remote. Returns a Future
inherited
createListener({bool synchronized = false}) → EventsListener<TrackerEvent>
inherited
dispose([dynamic reason]) Future
inherited
generateSecondTouchMessage(Uint8List connectionId, Map options) Uint8List
When communicating with announce and scrape, the data sent in the second communication is different after the first successful connection. This method is designed for subclasses to implement different data sending logic for announce and scrape
handleSocketDone() → void
handleSocketError(dynamic e) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processResponseData(Uint8List data, int action, Iterable<CompactAddress> addresses) → dynamic
Process the data obtained from the remote after one communication.
restart() Future<bool>
Restart the loop to initiate the announce visit.
inherited
start() Future<bool>
Start a loop to initiate an announce visit.
inherited
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.
override
stopIntervalAnnounce() → void
inherited
toString() String
A string representation of this object.
inherited

Operators

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