Class Torrent
Inheritance
Implements
Inherited Members
Namespace: MonoTorrent
Assembly: MonoTorrent.dll
Syntax
public sealed class Torrent : IEquatable<Torrent>
Properties
AnnounceUrls
The announce URLs contained within the .torrent file
Declaration
public IList<IList<string>> AnnounceUrls { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<System.Collections.Generic.IList<System.String>> |
Comment
The comment contained within the .torrent file
Declaration
public string Comment { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
CreatedBy
The optional string showing who/what created the .torrent
Declaration
public string CreatedBy { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
CreationDate
The creation date of the .torrent file
Declaration
public DateTime CreationDate { get; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
ED2K
The optional ED2K hash contained within the .torrent file
Declaration
public byte[] ED2K { get; }
Property Value
| Type | Description |
|---|---|
| System.Byte[] |
Encoding
The encoding used by the client that created the .torrent file
Declaration
public string Encoding { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Files
The list of files contained within the .torrent which are available for download
Declaration
public IList<TorrentFile> Files { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<TorrentFile> |
HttpSeeds
This is the http-based seeding (getright protocole)
Declaration
public IList<Uri> HttpSeeds { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<System.Uri> |
InfoHash
This is the infohash that is generated by putting the "Info" section of a .torrent through a ManagedSHA1 hasher.
Declaration
public InfoHash InfoHash { get; }
Property Value
| Type | Description |
|---|---|
| InfoHash |
IsPrivate
Shows whether DHT is allowed or not. If it is a private torrent, no peer sharing should be allowed.
Declaration
public bool IsPrivate { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Name
In the case of a single file torrent, this is the name of the file. In the case of a multi file torrent, it is the name of the root folder.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Nodes
The list of DHT nodes which can be used to bootstrap this torrent.
Declaration
public BEncodedList Nodes { get; }
Property Value
| Type | Description |
|---|---|
| BEncodedList |
PieceLength
The length of each piece in bytes.
Declaration
public int PieceLength { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Pieces
This is the array of hashes contained within the torrent.
Declaration
public Hashes Pieces { get; }
Property Value
| Type | Description |
|---|---|
| Hashes |
Publisher
The name of the Publisher
Declaration
public string Publisher { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
PublisherUrl
The Url of the publisher of either the content or the .torrent file
Declaration
public string PublisherUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
SHA1
The optional SHA1 hash contained within the .torrent file
Declaration
public byte[] SHA1 { get; }
Property Value
| Type | Description |
|---|---|
| System.Byte[] |
Size
The size of all files in bytes.
Declaration
public long Size { get; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
Source
The source of the torrent
Declaration
public string Source { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
Equals(Torrent)
Declaration
public bool Equals(Torrent other)
Parameters
| Type | Name | Description |
|---|---|---|
| Torrent | other |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
Load(BEncodedDictionary)
Declaration
public static Torrent Load(BEncodedDictionary torrentInformation)
Parameters
| Type | Name | Description |
|---|---|---|
| BEncodedDictionary | torrentInformation |
Returns
| Type | Description |
|---|---|
| Torrent |
Load(Byte[])
Loads a torrent from a byte[] containing the bencoded data
Declaration
public static Torrent Load(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | data | The byte[] containing the data |
Returns
| Type | Description |
|---|---|
| Torrent |
Load(Stream)
Loads a .torrent from the supplied stream
Declaration
public static Torrent Load(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The stream containing the data to load |
Returns
| Type | Description |
|---|---|
| Torrent |
Load(String)
This method loads a .torrent file from the specified path.
Declaration
public static Torrent Load(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | The path to load the .torrent file from |
Returns
| Type | Description |
|---|---|
| Torrent |
Load(Uri, String)
Loads a .torrent file from the specified URL
Declaration
public static Torrent Load(Uri url, string location)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | url | The URL to download the .torrent from |
| System.String | location | The path to download the .torrent to before it gets loaded |
Returns
| Type | Description |
|---|---|
| Torrent |
LoadAsync(Byte[])
Loads a torrent from a byte[] containing the bencoded data
Declaration
public static Task<Torrent> LoadAsync(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | data | The byte[] containing the data |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Torrent> |
LoadAsync(Stream)
Loads a .torrent from the supplied stream
Declaration
public static Task<Torrent> LoadAsync(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The stream containing the data to load |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Torrent> |
LoadAsync(String)
This method loads a .torrent file from the specified path.
Declaration
public static Task<Torrent> LoadAsync(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | The path to load the .torrent file from |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Torrent> |
LoadAsync(Uri, String)
Loads a .torrent file from the specified URL
Declaration
public static Task<Torrent> LoadAsync(Uri url, string location)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | url | The URL to download the .torrent from |
| System.String | location | The path to download the .torrent to before it gets loaded |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Torrent> |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
TryLoad(Byte[], out Torrent)
Loads a .torrent from the specified byte[]. A return value indicates whether the operation was successful.
Declaration
public static bool TryLoad(byte[] data, out Torrent torrent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | data | The byte[] to load the .torrent from |
| Torrent | torrent | If loading was successful, it contains the Torrent |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful |
TryLoad(Stream, out Torrent)
Loads a .torrent from the supplied stream. A return value indicates whether the operation was successful.
Declaration
public static bool TryLoad(Stream stream, out Torrent torrent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The stream containing the data to load |
| Torrent | torrent | If the loading was succesful it is assigned the Torrent |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful |
TryLoad(String, out Torrent)
Loads a .torrent from the specificed path. A return value indicates whether the operation was successful.
Declaration
public static bool TryLoad(string path, out Torrent torrent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | The path to load the .torrent file from |
| Torrent | torrent | If the loading was succesful it is assigned the Torrent |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful |
TryLoad(Uri, String, out Torrent)
Loads a .torrent file from the specified URL. A return value indicates whether the operation was successful.
Declaration
public static bool TryLoad(Uri url, string location, out Torrent torrent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | url | The URL to download the .torrent from |
| System.String | location | The path to download the .torrent to before it gets loaded |
| Torrent | torrent | If the loading was succesful it is assigned the Torrent |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful |