added support to bind outgoing connections to specific ports (might be useful to do traffic shaping)
This commit is contained in:
@@ -375,6 +375,8 @@ namespace libtorrent
|
||||
void stop_natpmp();
|
||||
void stop_upnp();
|
||||
|
||||
int next_port();
|
||||
|
||||
// handles delayed alerts
|
||||
alert_manager m_alerts;
|
||||
|
||||
@@ -551,6 +553,10 @@ namespace libtorrent
|
||||
void second_tick(asio::error_code const& e);
|
||||
ptime m_last_tick;
|
||||
|
||||
// when outgoing_ports is configured, this is the
|
||||
// port we'll bind the next outgoing socket to
|
||||
int m_next_port;
|
||||
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
boost::intrusive_ptr<dht::dht_tracker> m_dht;
|
||||
dht_settings m_dht_settings;
|
||||
|
@@ -126,6 +126,7 @@ namespace libtorrent
|
||||
, auto_upload_slots(true)
|
||||
, cache_size(512)
|
||||
, cache_expiry(60)
|
||||
, outgoing_ports(0,0)
|
||||
{}
|
||||
|
||||
// this is the user agent that will be sent to the tracker
|
||||
@@ -332,6 +333,12 @@ namespace libtorrent
|
||||
// idle in the cache before it's forcefully flushed
|
||||
// to disk. Default is 60 seconds.
|
||||
int cache_expiry;
|
||||
|
||||
// if != (0, 0), this is the range of ports that
|
||||
// outgoing connections will be bound to. This
|
||||
// is useful for users that have routers that
|
||||
// allow QoS settings based on local port.
|
||||
std::pair<int, int> outgoing_ports;
|
||||
};
|
||||
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
|
Reference in New Issue
Block a user