public final class SettingsPack
extends java.lang.Object
Constructor and Description |
---|
SettingsPack()
Example, how to turn on the DHT using SettingsPack.
|
SettingsPack(settings_pack sp) |
Modifier and Type | Method and Description |
---|---|
int |
activeChecking()
active_checking is the limit of number of simultaneous checking
torrents. |
SettingsPack |
activeChecking(int value) |
int |
activeDhtLimit()
active_dht_limit is the max number of torrents to announce to
the DHT. |
SettingsPack |
activeDhtLimit(int value) |
int |
activeDownloads()
active_downloads controls how many active
downloading torrents the queuing mechanism allows. |
SettingsPack |
activeDownloads(int value) |
int |
activeLimit()
active_limit is a hard limit on the number of active (auto
managed) torrents. |
SettingsPack |
activeLimit(int value)
active_limit is a hard limit on the number of active (auto
managed) torrents. |
int |
activeLsdLimit()
active_lsd_limit is the max number of torrents to announce to
the local network over the local service discovery protocol. |
SettingsPack |
activeLsdLimit(int value) |
int |
activeSeeds()
active_seeds controls how many active seeding
torrents the queuing mechanism allows. |
SettingsPack |
activeSeeds(int value) |
int |
activeTrackerLimit()
active_tracker_limit is the max number of torrents to announce
to their trackers. |
SettingsPack |
activeTrackerLimit(int value) |
int |
alertQueueSize() |
SettingsPack |
alertQueueSize(int value)
alert_queue_size is the maximum number of alerts queued up
internally. |
boolean |
anonymousMode() |
SettingsPack |
anonymousMode(boolean value)
defaults to false.
|
boolean |
broadcastLSD() |
SettingsPack |
broadcastLSD(boolean value) |
int |
cacheSize()
Sets the disk write and read cache.
|
SettingsPack |
cacheSize(int value)
Sets the disk write and read cache.
|
void |
clear() |
void |
clear(int name) |
int |
connectionsLimit() |
SettingsPack |
connectionsLimit(int value)
Sets a global limit on the number of connections opened.
|
int |
downloadRateLimit() |
SettingsPack |
downloadRateLimit(int value)
Sets the session-global limits of download rate limit, in
bytes per second.
|
boolean |
enableDht() |
SettingsPack |
enableDht(boolean value)
Starts the dht node and makes the trackerless service available to
torrents.
|
boolean |
getBoolean(int name) |
int |
getInteger(int name) |
java.lang.String |
getString(int name) |
int |
inactivityTimeout() |
SettingsPack |
inactivityTimeout(int value)
if a peer is uninteresting and uninterested for longer than this
number of seconds, it will be disconnected.
|
java.lang.String |
listenInterfaces() |
SettingsPack |
listenInterfaces(java.lang.String value) |
int |
maxPeerlistSize() |
SettingsPack |
maxPeerlistSize(int value)
Sets the maximum number of peers in the list of known peers.
|
int |
maxQueuedDiskBytes() |
SettingsPack |
maxQueuedDiskBytes(int value)
Sets the maximum number of bytes a connection may have pending in the disk
write queue before its download rate is being throttled.
|
boolean |
seedingOutgoingConnections() |
SettingsPack |
seedingOutgoingConnections(boolean value)
Determines if seeding (and finished) torrents should attempt to make
outgoing connections or not.
|
int |
sendBufferWatermark() |
SettingsPack |
sendBufferWatermark(int value)
Sets the upper limit of the send buffer low-watermark.
|
SettingsPack |
setBoolean(int name,
boolean value) |
SettingsPack |
setInteger(int name,
int value) |
SettingsPack |
setString(int name,
java.lang.String value) |
int |
stopTrackerTimeout() |
SettingsPack |
stopTrackerTimeout(int value)
stop_tracker_timeout is the number of seconds to wait when
sending a stopped message before considering a tracker to have
timed out. |
settings_pack |
swig() |
int |
tickInterval() |
SettingsPack |
tickInterval(int value)
Specifies the number of milliseconds between internal ticks.
|
int |
uploadRateLimit() |
SettingsPack |
uploadRateLimit(int value)
Sets the session-global limits of upload rate limit, in
bytes per second.
|
boolean |
upnpIgnoreNonRouters()
Indicates whether or not the UPnP implementation should ignore any
broadcast response from a device whose address is not the configured
router for this machine.
|
SettingsPack |
upnpIgnoreNonRouters(boolean value)
Indicates whether or not the UPnP implementation should ignore any
broadcast response from a device whose address is not the configured
router for this machine.
|
public SettingsPack(settings_pack sp)
public SettingsPack()
SettingsPack pack = new SettingsPack();
pack.setBoolean(settings_pack.bool_types.enable_dht.swigValue(), on);
s.applySettings(pack);
public settings_pack swig()
public boolean getBoolean(int name)
name
- public SettingsPack setBoolean(int name, boolean value)
name
- value
- public int getInteger(int name)
name
- public SettingsPack setInteger(int name, int value)
name
- value
- public java.lang.String getString(int name)
name
- public SettingsPack setString(int name, java.lang.String value)
name
- value
- public void clear()
public void clear(int name)
public int downloadRateLimit()
public SettingsPack downloadRateLimit(int value)
A value of 0 means unlimited.
value
- public int uploadRateLimit()
public SettingsPack uploadRateLimit(int value)
A value of 0 means unlimited.
value
- public int activeDownloads()
active_downloads
controls how many active
downloading torrents the queuing mechanism allows.
The target number of active torrents is min(active_downloads +
active_seeds, active_limit)
. active_downloads
and
active_seeds
are upper limits on the number of downloading
torrents and seeding torrents respectively. Setting the value to -1
means unlimited.
For auto managed torrents, these are the limits they are subject to. If there are too many torrents some of the auto managed ones will be paused until some slots free up.
You can have more torrents *active*, even though they are not announced to the DHT, lsd or their tracker. If some peer knows about you for any reason and tries to connect, it will still be accepted, unless the torrent is paused, which means it won't accept any connections.
For example if there are 10 seeding torrents and 10 downloading torrents, and ``active_downloads`` is 4 and ``active_seeds`` is 4, there will be 4 seeds active and 4 downloading torrents. If the settings are ``active_downloads`` = 2 and ``active_seeds`` = 4, then there will be 2 downloading torrents and 4 seeding torrents active. Torrents that are not auto managed are also counted against these limits. If there are non-auto managed torrents that use up all the slots, no auto managed torrent will be activated.
public SettingsPack activeDownloads(int value)
value
- activeDownloads()
public int activeSeeds()
active_seeds
controls how many active seeding
torrents the queuing mechanism allows.activeDownloads()
public SettingsPack activeSeeds(int value)
value
- activeSeeds()
public int activeChecking()
active_checking
is the limit of number of simultaneous checking
torrents.activeDownloads()
public SettingsPack activeChecking(int value)
value
- activeChecking()
public int activeDhtLimit()
active_dht_limit
is the max number of torrents to announce to
the DHT. By default this is set to 88, which is no more than one
DHT announce every 10 seconds.activeDownloads()
public SettingsPack activeDhtLimit(int value)
value
- activeDhtLimit()
public int activeTrackerLimit()
active_tracker_limit
is the max number of torrents to announce
to their trackers. By default this is 360, which is no more than
one announce every 5 seconds.activeDownloads()
public SettingsPack activeTrackerLimit(int value)
value
- activeTrackerLimit()
public int activeLsdLimit()
active_lsd_limit
is the max number of torrents to announce to
the local network over the local service discovery protocol. By
default this is 80, which is no more than one announce every 5
seconds (assuming the default announce interval of 5 minutes).activeDownloads()
public SettingsPack activeLsdLimit(int value)
value
- activeLsdLimit()
public int activeLimit()
active_limit
is a hard limit on the number of active (auto
managed) torrents. This limit also applies to slow torrents.activeDownloads()
public SettingsPack activeLimit(int value)
active_limit
is a hard limit on the number of active (auto
managed) torrents. This limit also applies to slow torrents.value
- the valueactiveLimit()
public int connectionsLimit()
public SettingsPack connectionsLimit(int value)
value
- public int maxPeerlistSize()
public SettingsPack maxPeerlistSize(int value)
value
- public int maxQueuedDiskBytes()
public SettingsPack maxQueuedDiskBytes(int value)
When this limit is reached, the peer connections will stop reading data from their sockets, until the disk thread catches up. Setting this too low will severely limit your download rate.
value
- public int sendBufferWatermark()
public SettingsPack sendBufferWatermark(int value)
if the send buffer has fewer bytes than this, we'll read another 16kB block onto it. If set too small, upload rate capacity will suffer. If set too high, memory will be wasted. The actual watermark may be lower than this in case the upload rate is low, this is the upper limit.
value
- public int cacheSize()
public SettingsPack cacheSize(int value)
value
- the new valuepublic int tickInterval()
public SettingsPack tickInterval(int value)
value
- public int inactivityTimeout()
public SettingsPack inactivityTimeout(int value)
value
- public boolean seedingOutgoingConnections()
public SettingsPack seedingOutgoingConnections(boolean value)
value
- public boolean anonymousMode()
public SettingsPack anonymousMode(boolean value)
If you're using I2P, a VPN or a proxy, it might make sense to enable anonymous mode.
value
- public boolean broadcastLSD()
public SettingsPack broadcastLSD(boolean value)
public boolean enableDht()
public SettingsPack enableDht(boolean value)
value
- public java.lang.String listenInterfaces()
public SettingsPack listenInterfaces(java.lang.String value)
value
- public int stopTrackerTimeout()
stopTrackerTimeout(int)
public SettingsPack stopTrackerTimeout(int value)
stop_tracker_timeout
is the number of seconds to wait when
sending a stopped message before considering a tracker to have
timed out. This is usually shorter, to make the client quit faster.
If the value is set to 0, the connections to trackers with the
stopped event are suppressed.value
- the new valuepublic int alertQueueSize()
alertQueueSize(int)
public SettingsPack alertQueueSize(int value)
alert_queue_size
is the maximum number of alerts queued up
internally. If alerts are not popped, the queue will eventually
fill up to this level.value
- the new valuepublic boolean upnpIgnoreNonRouters()
public SettingsPack upnpIgnoreNonRouters(boolean value)
value
- the new value