/// <summary> /// Create the Tracker class. /// </summary> /// <param name="peerID"></param> /// <param name="urlTracker"></param> /// <param name="infoHash">This is the Bencoded info value.</param> /// <param name="ip"></param> /// <param name="port"></param> public Tracker(PeerID peerID, string urlTracker, byte [] infoHash, string ip, int port) : this() { this.peerID = peerID; this.urlTracker = urlTracker; this.infoHash = SHA1.HashValue(infoHash); this.ip = ip; this.port = port; }
public Peer() { peerID = new PeerID(); peerIP = "192.168.1.2"; peerPort = 6968; }
public Tracker() { urlTracker = string.Empty; response = new Dictionary(); infoHash = null; peerID = null; ip = string.Empty; port = 0; uploaded = downloaded = left = 0; status = TrackerEvents.empty; requestInterval = 0; trackerResponse = null; timer = null; }
/// <summary> /// Create a PeerID from another Peer. /// </summary> /// <param name="peerID">The source Peer ID</param> public PeerID(PeerID peerID) { this.peerID = new byte[20]; // Copy Id this.peerID = (byte[])peerID.peerID.Clone(); }