Class EngineSettingsBuilder
Represents the Settings which need to be passed to the engine
Inheritance
System.Object
EngineSettingsBuilder
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 EngineSettingsBuilder
Constructors
EngineSettingsBuilder()
Declaration
public EngineSettingsBuilder()
EngineSettingsBuilder(EngineSettings)
Declaration
public EngineSettingsBuilder(EngineSettings settings)
Parameters
Properties
AllowedEncryption
A prioritised list of encryption methods, including plain text, which can be used to connect to another peer.
Connections will be attempted in the same order as they are in the list. Defaults to RC4Header,
RC4Full and PlainText.
Declaration
public IList<EncryptionType> AllowedEncryption { get; set; }
Property Value
AllowHaveSuppression
Have suppression reduces the number of Have messages being sent by only sending Have messages to peers
which do not already have that piece. A peer will never request a piece they have already downloaded,
so informing them that we have that piece is not beneficial. Defaults to false.
Declaration
public bool AllowHaveSuppression { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
AllowLocalPeerDiscovery
True if the engine should use LocalPeerDiscovery to search for local peers. Defaults to true.
Declaration
public bool AllowLocalPeerDiscovery { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
AllowPortForwarding
True if the engine should automatically forward ports using any compatible UPnP or NAT-PMP device.
Defaults to true.
Declaration
public bool AllowPortForwarding { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
AutoSaveLoadDhtCache
If set to true dht nodes will be implicitly saved when there are no active TorrentManager instances in the engine.
Dht nodes will be restored when the first TorrentManager is started. Otherwise dht nodes will not be cached between
restarts and the DhtEngine will have to bootstrap from scratch each time.
Defaults to true.
Declaration
public bool AutoSaveLoadDhtCache { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
AutoSaveLoadFastResume
If set to true FastResume data will be implicitly saved after StopAsync() is invoked,
and will be implicitly loaded before the TorrentManager is returned by AddAsync(MagnetLink, String)
Otherwise fast resume data will not be saved or restored and TorrentManager
instances will have to perform a full hash check when they start.
Defaults to true.
Declaration
public bool AutoSaveLoadFastResume { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
This setting affects torrents downloaded using a MagnetLink. When enabled, metadata for the torrent will be loaded
from MetadataCacheDirectory, if it exists, when the MagnetLink is added to the engine using
AddAsync(MagnetLink, String). Additionally, metadata will be written to this directory if it is successfully retrieved
from peers so future downloads can start immediately.
Defaults to true.
Declaration
public bool AutoSaveLoadMagnetLinkMetadata { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
CacheDirectory
The directory used to cache any data needed by the engine. Typically used to store a
cache of the DHT table to improve bootstrapping speed, any metadata downloaded
using a magnet link, or fast resume data for individual torrents.
When ToSettings() is invoked the value will be converted to a full path
if it is not already a full path, or will be replaced with
System.Environment.CurrentDirectory if the value is null or empty.
Declaration
public string CacheDirectory { get; set; }
Property Value
| Type |
Description |
| System.String |
|
ConnectionTimeout
If a connection attempt does not complete within the given timeout, it will be cancelled so
a connection can be attempted with a new peer. Defaults to 10 seconds. It is highly recommended
to keep this value within a range of 7-15 seconds unless absolutely necessary.
Declaration
public TimeSpan ConnectionTimeout { get; set; }
Property Value
| Type |
Description |
| System.TimeSpan |
|
DhtPort
The UDP port used for DHT communications. Use 0 to choose a random available port.
Choose -1 to disable DHT. Defaults to 0.
Declaration
public int DhtPort { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
DiskCacheBytes
Creates a cache which buffers data before it's written to the disk, or after it's been read from disk.
Set to 0 to disable the cache.
Defaults to 5MB.
Declaration
public int DiskCacheBytes { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
FastResumeMode
When AutoSaveLoadFastResume is true, this setting is used to control how fast
resume data is maintained, otherwise it has no effect. You can prioritise accuracy (at the risk of requiring full hash checks if an actively downloading
torrent does not cleanly enter the Stopped state) by choosing Accurate.
You can prioritise torrent start speed (at the risk of re-downloading a small amount of data) by choosing BestEffort,
in which case a recent, not not 100% accurate, copy of the fast resume data will be loaded whenever it is available. if an actively downloading Torrent does not
cleanly enter the Stopped state.
Defaults to BestEffort.
Declaration
public FastResumeMode FastResumeMode { get; set; }
Property Value
ListenPort
The TCP port the engine should listen on for incoming connections. Use 0 to choose a random
available port. Choose -1 to disable listening for incoming connections. Defaults to 0.
Declaration
public int ListenPort { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaximumConnections
The maximum number of concurrent open connections overall. Defaults to 150.
Declaration
public int MaximumConnections { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaximumDiskReadRate
The maximum disk read speed, in bytes per second. A value of 0 means unlimited. This is
typically only useful for non-SSD drives to prevent the hashing process from saturating
the available drive bandwidth. Defaults to 0.
Declaration
public int MaximumDiskReadRate { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaximumDiskWriteRate
The maximum disk write speed, in bytes per second. A value of 0 means unlimited. This is
typically only useful for non-SSD drives to prevent the downloading process from saturating
the available drive bandwidth. If the download speed exceeds the max write rate then the
download will be throttled. Defaults to 0.
Declaration
public int MaximumDiskWriteRate { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaximumDownloadSpeed
The maximum download speed, in bytes per second, overall. A value of 0 means unlimited. Defaults to 0.
Declaration
public int MaximumDownloadSpeed { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaximumHalfOpenConnections
The maximum number of concurrent connection attempts overall. Defaults to 8.
Declaration
public int MaximumHalfOpenConnections { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaximumOpenFiles
The maximum number of files which can be opened concurrently. On platforms which limit the maximum
filehandles for a process it can be beneficial to limit the number of open files to prevent
running out of resources. A value of 0 means unlimited, but this is not recommended. Defaults to 20.
Declaration
public int MaximumOpenFiles { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaximumUploadSpeed
The maximum upload speed, in bytes per second, overall. A value of 0 means unlimited. defaults to 0.
Declaration
public int MaximumUploadSpeed { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
ReportedAddress
If the IPAddress incoming peer connections are received on differs from the IPAddress the tracker
Announce or Scrape requests are sent from, specify it here. Typically this should not be set.
Defaults to null
Declaration
public IPEndPoint ReportedAddress { get; set; }
Property Value
| Type |
Description |
| System.Net.IPEndPoint |
|
Methods
ToSettings()
Declaration
public EngineSettings ToSettings()
Returns