improve documentation for protocol encryption

This commit is contained in:
arvidn 2015-07-17 21:59:10 -04:00
parent d83be0f2ca
commit 7b379b1740
1 changed files with 11 additions and 0 deletions

View File

@ -1468,6 +1468,17 @@ namespace libtorrent
// control the settings for incoming and outgoing connections
// respectively. see enc_policy enum for the available options.
// Keep in mind that protocol encryption degrades performance in
// several respects:
// 1. It prevents "zero copy" disk buffers being sent to peers, since
// each peer needs to mutate the data (i.e. encrypt it) the data
// must be copied per peer connection rather than sending the same
// buffer to multiple peers.
// 2. The encryption itself requires more CPU than plain bittorrent
// protocol. The highest cost is the Diffie Hellman exchange on
// connection setup.
// 3. The encryption handshake adds several round-trips to the
// connection setup, and delays transferring data.
out_enc_policy,
in_enc_policy,