Show / Hide Table of Contents

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()
Namespace: MonoTorrent.Client
Assembly: MonoTorrent.dll
Syntax
public class ClientEngine : IDisposable

Constructors

ClientEngine()

Declaration
public ClientEngine()

ClientEngine(EngineSettings)

Declaration
public ClientEngine(EngineSettings settings)
Parameters
Type Name Description
EngineSettings settings

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
Type Description
ConnectionManager

DhtEngine

Declaration
public IDhtEngine DhtEngine { get; }
Property Value
Type Description
IDhtEngine

DiskManager

Declaration
public DiskManager DiskManager { get; }
Property Value
Type Description
DiskManager

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
Type Description
BEncodedString

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
Type Description
Mappings

Settings

Declaration
public EngineSettings Settings { get; }
Property Value
Type Description
EngineSettings

Torrents

Declaration
public IList<TorrentManager> Torrents { get; }
Property Value
Type Description
System.Collections.Generic.IList<TorrentManager>

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
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddAsync(MagnetLink, String, TorrentSettings)

Declaration
public Task<TorrentManager> AddAsync(MagnetLink magnetLink, string saveDirectory, TorrentSettings settings)
Parameters
Type Name Description
MagnetLink magnetLink
System.String saveDirectory
TorrentSettings settings
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddAsync(Torrent, String)

Declaration
public Task<TorrentManager> AddAsync(Torrent torrent, string saveDirectory)
Parameters
Type Name Description
Torrent torrent
System.String saveDirectory
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddAsync(Torrent, String, TorrentSettings)

Declaration
public Task<TorrentManager> AddAsync(Torrent torrent, string saveDirectory, TorrentSettings settings)
Parameters
Type Name Description
Torrent torrent
System.String saveDirectory
TorrentSettings settings
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddAsync(String, String)

Declaration
public Task<TorrentManager> AddAsync(string metadataPath, string saveDirectory)
Parameters
Type Name Description
System.String metadataPath
System.String saveDirectory
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

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
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddStreamingAsync(MagnetLink, String)

Declaration
public Task<TorrentManager> AddStreamingAsync(MagnetLink magnetLink, string saveDirectory)
Parameters
Type Name Description
MagnetLink magnetLink
System.String saveDirectory
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddStreamingAsync(MagnetLink, String, TorrentSettings)

Declaration
public Task<TorrentManager> AddStreamingAsync(MagnetLink magnetLink, string saveDirectory, TorrentSettings settings)
Parameters
Type Name Description
MagnetLink magnetLink
System.String saveDirectory
TorrentSettings settings
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddStreamingAsync(Torrent, String)

Declaration
public Task<TorrentManager> AddStreamingAsync(Torrent torrent, string saveDirectory)
Parameters
Type Name Description
Torrent torrent
System.String saveDirectory
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddStreamingAsync(Torrent, String, TorrentSettings)

Declaration
public Task<TorrentManager> AddStreamingAsync(Torrent torrent, string saveDirectory, TorrentSettings settings)
Parameters
Type Name Description
Torrent torrent
System.String saveDirectory
TorrentSettings settings
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

AddStreamingAsync(String, String)

Declaration
public Task<TorrentManager> AddStreamingAsync(string metadataPath, string saveDirectory)
Parameters
Type Name Description
System.String metadataPath
System.String saveDirectory
Returns
Type Description
System.Threading.Tasks.Task<TorrentManager>

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
Type Description
System.Threading.Tasks.Task<TorrentManager>

ChangePieceWriterAsync(IPieceWriter)

Declaration
public Task ChangePieceWriterAsync(IPieceWriter writer)
Parameters
Type Name Description
IPieceWriter writer
Returns
Type Description
System.Threading.Tasks.Task

Contains(TorrentManager)

Declaration
public bool Contains(TorrentManager manager)
Parameters
Type Name Description
TorrentManager manager
Returns
Type Description
System.Boolean

Contains(InfoHash)

Declaration
public bool Contains(InfoHash infoHash)
Parameters
Type Name Description
InfoHash infoHash
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
public void Dispose()

DownloadMetadataAsync(MagnetLink, CancellationToken)

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
public Task PauseAll()
Returns
Type Description
System.Threading.Tasks.Task

RemoveAsync(TorrentManager)

Declaration
public Task<bool> RemoveAsync(TorrentManager manager)
Parameters
Type Name Description
TorrentManager manager
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

RemoveAsync(TorrentManager, RemoveMode)

Declaration
public Task<bool> RemoveAsync(TorrentManager manager, RemoveMode mode)
Parameters
Type Name Description
TorrentManager manager
RemoveMode mode
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

RemoveAsync(MagnetLink)

Declaration
public Task<bool> RemoveAsync(MagnetLink magnetLink)
Parameters
Type Name Description
MagnetLink magnetLink
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

RemoveAsync(MagnetLink, RemoveMode)

Declaration
public Task<bool> RemoveAsync(MagnetLink magnetLink, RemoveMode mode)
Parameters
Type Name Description
MagnetLink magnetLink
RemoveMode mode
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
Type Name Description
Torrent torrent
RemoveMode mode
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
Type Description
System.Threading.Tasks.Task<ClientEngine>

RestoreStateAsync(String)

Declaration
public static Task<ClientEngine> RestoreStateAsync(string pathToStateFile)
Parameters
Type Name Description
System.String pathToStateFile
Returns
Type Description
System.Threading.Tasks.Task<ClientEngine>

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()

Stops all active TorrentManager instances.

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
Type Name Description
EngineSettings settings
Returns
Type Description
System.Threading.Tasks.Task

Events

CriticalException

Declaration
public event EventHandler<CriticalExceptionEventArgs> CriticalException
Event Type
Type Description
System.EventHandler<CriticalExceptionEventArgs>

StatsUpdate

Declaration
public event EventHandler<StatsUpdateEventArgs> StatsUpdate
Event Type
Type Description
System.EventHandler<StatsUpdateEventArgs>

Implements

System.IDisposable
In This Article
Back to top Generated by DocFX