Class ClientEngine
The Engine that contains the TorrentManagers
Inheritance
System.Object
ClientEngine
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: MonoTorrent.dll
Syntax
public class ClientEngine : IDisposable
Constructors
ClientEngine()
Declaration
ClientEngine(EngineSettings)
Declaration
public ClientEngine(EngineSettings settings)
Parameters
Fields
SupportsDht
Declaration
public static readonly bool SupportsDht
Field Value
| Type |
Description |
| System.Boolean |
|
SupportsEncryption
Declaration
public static readonly bool SupportsEncryption
Field Value
| Type |
Description |
| System.Boolean |
|
SupportsEndgameMode
Declaration
public static readonly bool SupportsEndgameMode
Field Value
| Type |
Description |
| System.Boolean |
|
SupportsExtended
Declaration
public static readonly bool SupportsExtended
Field Value
| Type |
Description |
| System.Boolean |
|
SupportsFastPeer
Declaration
public static readonly bool SupportsFastPeer
Field Value
| Type |
Description |
| System.Boolean |
|
SupportsInitialSeed
Declaration
public static readonly bool SupportsInitialSeed
Field Value
| Type |
Description |
| System.Boolean |
|
SupportsLocalPeerDiscovery
Declaration
public static readonly bool SupportsLocalPeerDiscovery
Field Value
| Type |
Description |
| System.Boolean |
|
SupportsWebSeed
Declaration
public static readonly bool SupportsWebSeed
Field Value
| Type |
Description |
| System.Boolean |
|
Properties
ConnectionManager
Declaration
public ConnectionManager ConnectionManager { get; }
Property Value
DhtEngine
Declaration
public IDhtEngine DhtEngine { get; }
Property Value
DiskManager
Declaration
public DiskManager DiskManager { get; }
Property Value
Disposed
Declaration
public bool Disposed { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
IsRunning
Declaration
public bool IsRunning { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
PeerId
Declaration
public BEncodedString PeerId { get; }
Property Value
PortMappings
When AllowPortForwarding is set to true, this will return a representation
of the ports the engine is managing.
Declaration
public Mappings PortMappings { get; }
Property Value
Settings
Declaration
public EngineSettings Settings { get; }
Property Value
Torrents
Declaration
public IList<TorrentManager> Torrents { get; }
Property Value
TotalDownloadSpeed
Declaration
public long TotalDownloadSpeed { get; }
Property Value
| Type |
Description |
| System.Int64 |
|
TotalUploadSpeed
Declaration
public long TotalUploadSpeed { get; }
Property Value
| Type |
Description |
| System.Int64 |
|
Methods
AddAsync(MagnetLink, String)
Declaration
public Task<TorrentManager> AddAsync(MagnetLink magnetLink, string saveDirectory)
Parameters
| Type |
Name |
Description |
| MagnetLink |
magnetLink |
|
| System.String |
saveDirectory |
|
Returns
AddAsync(MagnetLink, String, TorrentSettings)
Declaration
public Task<TorrentManager> AddAsync(MagnetLink magnetLink, string saveDirectory, TorrentSettings settings)
Parameters
Returns
AddAsync(Torrent, String)
Declaration
public Task<TorrentManager> AddAsync(Torrent torrent, string saveDirectory)
Parameters
| Type |
Name |
Description |
| Torrent |
torrent |
|
| System.String |
saveDirectory |
|
Returns
AddAsync(Torrent, String, TorrentSettings)
Declaration
public Task<TorrentManager> AddAsync(Torrent torrent, string saveDirectory, TorrentSettings settings)
Parameters
Returns
AddAsync(String, String)
Declaration
public Task<TorrentManager> AddAsync(string metadataPath, string saveDirectory)
Parameters
| Type |
Name |
Description |
| System.String |
metadataPath |
|
| System.String |
saveDirectory |
|
Returns
AddAsync(String, String, TorrentSettings)
Declaration
public Task<TorrentManager> AddAsync(string metadataPath, string saveDirectory, TorrentSettings settings)
Parameters
| Type |
Name |
Description |
| System.String |
metadataPath |
|
| System.String |
saveDirectory |
|
| TorrentSettings |
settings |
|
Returns
AddStreamingAsync(MagnetLink, String)
Declaration
public Task<TorrentManager> AddStreamingAsync(MagnetLink magnetLink, string saveDirectory)
Parameters
| Type |
Name |
Description |
| MagnetLink |
magnetLink |
|
| System.String |
saveDirectory |
|
Returns
AddStreamingAsync(MagnetLink, String, TorrentSettings)
Declaration
public Task<TorrentManager> AddStreamingAsync(MagnetLink magnetLink, string saveDirectory, TorrentSettings settings)
Parameters
Returns
AddStreamingAsync(Torrent, String)
Declaration
public Task<TorrentManager> AddStreamingAsync(Torrent torrent, string saveDirectory)
Parameters
| Type |
Name |
Description |
| Torrent |
torrent |
|
| System.String |
saveDirectory |
|
Returns
AddStreamingAsync(Torrent, String, TorrentSettings)
Declaration
public Task<TorrentManager> AddStreamingAsync(Torrent torrent, string saveDirectory, TorrentSettings settings)
Parameters
Returns
AddStreamingAsync(String, String)
Declaration
public Task<TorrentManager> AddStreamingAsync(string metadataPath, string saveDirectory)
Parameters
| Type |
Name |
Description |
| System.String |
metadataPath |
|
| System.String |
saveDirectory |
|
Returns
AddStreamingAsync(String, String, TorrentSettings)
Declaration
public Task<TorrentManager> AddStreamingAsync(string metadataPath, string saveDirectory, TorrentSettings settings)
Parameters
| Type |
Name |
Description |
| System.String |
metadataPath |
|
| System.String |
saveDirectory |
|
| TorrentSettings |
settings |
|
Returns
ChangePieceWriterAsync(IPieceWriter)
Declaration
public Task ChangePieceWriterAsync(IPieceWriter writer)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Contains(TorrentManager)
Declaration
public bool Contains(TorrentManager manager)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Contains(InfoHash)
Declaration
public bool Contains(InfoHash infoHash)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Contains(Torrent)
Declaration
public bool Contains(Torrent torrent)
Parameters
| Type |
Name |
Description |
| Torrent |
torrent |
|
Returns
| Type |
Description |
| System.Boolean |
|
Dispose()
Declaration
Downloads the .torrent metadata for the provided MagnetLink.
Declaration
public Task<byte[]> DownloadMetadataAsync(MagnetLink magnetLink, CancellationToken token)
Parameters
| Type |
Name |
Description |
| MagnetLink |
magnetLink |
The MagnetLink to get the metadata for.
|
| System.Threading.CancellationToken |
token |
The cancellation token used to to abort the download. This method will
only complete if the metadata successfully downloads, or the token is cancelled.
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Byte[]> |
|
PauseAll()
Declaration
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
RemoveAsync(TorrentManager)
Declaration
public Task<bool> RemoveAsync(TorrentManager manager)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Boolean> |
|
RemoveAsync(TorrentManager, RemoveMode)
Declaration
public Task<bool> RemoveAsync(TorrentManager manager, RemoveMode mode)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Boolean> |
|
RemoveAsync(MagnetLink)
Declaration
public Task<bool> RemoveAsync(MagnetLink magnetLink)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Boolean> |
|
RemoveAsync(MagnetLink, RemoveMode)
Declaration
public Task<bool> RemoveAsync(MagnetLink magnetLink, RemoveMode mode)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Boolean> |
|
RemoveAsync(Torrent)
Declaration
public Task<bool> RemoveAsync(Torrent torrent)
Parameters
| Type |
Name |
Description |
| Torrent |
torrent |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Boolean> |
|
RemoveAsync(Torrent, RemoveMode)
Declaration
public Task<bool> RemoveAsync(Torrent torrent, RemoveMode mode)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Boolean> |
|
RestoreStateAsync(Byte[])
Declaration
public static Task<ClientEngine> RestoreStateAsync(byte[] buffer)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
buffer |
|
Returns
RestoreStateAsync(String)
Declaration
public static Task<ClientEngine> RestoreStateAsync(string pathToStateFile)
Parameters
| Type |
Name |
Description |
| System.String |
pathToStateFile |
|
Returns
SaveStateAsync()
Declaration
public Task<byte[]> SaveStateAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Byte[]> |
|
SaveStateAsync(String)
Declaration
public Task SaveStateAsync(string pathToStateFile)
Parameters
| Type |
Name |
Description |
| System.String |
pathToStateFile |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
StartAllAsync()
Declaration
public Task StartAllAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
StopAllAsync()
Declaration
public Task StopAllAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
StopAllAsync(TimeSpan)
Stops all active TorrentManager instances. The final announce for each TorrentManager will be limited
to the maximum of either 2 seconds or timeout seconds.
Declaration
public Task StopAllAsync(TimeSpan timeout)
Parameters
| Type |
Name |
Description |
| System.TimeSpan |
timeout |
The timeout for the final tracker announce.
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
UpdateSettingsAsync(EngineSettings)
Declaration
public Task UpdateSettingsAsync(EngineSettings settings)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Events
CriticalException
Declaration
public event EventHandler<CriticalExceptionEventArgs> CriticalException
Event Type
StatsUpdate
Declaration
public event EventHandler<StatsUpdateEventArgs> StatsUpdate
Event Type
Implements
System.IDisposable