Discussion:
[libtorrent] Outgoing Interfaces in settings_pack
Viren Negi
2017-04-11 05:21:36 UTC
Permalink
I'm trying to improvise on the simple_client.cc example. I going through
the settings_pack documentation after reading through the
outgoing_interface explanation.


Firstly, the outgoing interfaces represent the interfaces via which the
piece upload is supposed to happen, right?

The important point I want to bring in here is

sets the network interface this session
<http://libtorrent.org/reference-Core.html#session> will use when it opens
outgoing connections. By default, it binds outgoing connections to
INADDR_ANY and port 0 (i.e. let the OS decide). Ths parameter must be a
string containing one or more, comma separated, adapter names. Adapter
names on unix systems are of the form "eth0", "eth1", "tun0", etc. When
specifying multiple interfaces, they will be assigned in round-robin order.
This may be useful for clients that are multi-homed. Binding an outgoing
connection to a local IP does not necessarily make the connection via the
associated NIC/Adapter. *Setting this to an empty string will disable
binding of outgoing connections.*




So, If the outbound_interfaces is set to empty string no upload will would
take place.

is my understand correct?
Arvid Norberg
2017-04-11 12:31:48 UTC
Permalink
Post by Viren Negi
I'm trying to improvise on the simple_client.cc example. I going through
the settings_pack documentation after reading through the
outgoing_interface explanation.
Firstly, the outgoing interfaces represent the interfaces via which the
piece upload is supposed to happen, right?
That may be the case, but not necessarily. There is no portable way to
directly specify which interface packets are sent over.
Post by Viren Negi
The important point I want to bring in here is
sets the network interface this session
<http://libtorrent.org/reference-Core.html#session> will use when it opens
outgoing connections. By default, it binds outgoing connections to
INADDR_ANY and port 0 (i.e. let the OS decide). Ths parameter must be a
string containing one or more, comma separated, adapter names. Adapter
names on unix systems are of the form "eth0", "eth1", "tun0", etc. When
specifying multiple interfaces, they will be assigned in round-robin order.
This may be useful for clients that are multi-homed. Binding an outgoing
connection to a local IP does not necessarily make the connection via the
associated NIC/Adapter. *Setting this to an empty string will disable
binding of outgoing connections.*
So, If the outbound_interfaces is set to empty string no upload will would
take place.
is my understand correct?
No, it will just disable *binding* the sockets. By default the operating
system will pick a local IP address and port for you.
--
Arvid Norberg
Loading...