Furrent
Classes | Enumerations | Functions | Variables
fur::download::downloader Namespace Reference

Classes

class  Downloader
 

Enumerations

enum  DownloaderError {
  DownloaderError::DifferentInfoHash, DownloaderError::InvalidMessage, DownloaderError::NoBitfield, DownloaderError::MissingPiece,
  DownloaderError::CorruptPiece, DownloaderError::SocketTimeout, DownloaderError::SocketOther
}
 

Functions

DownloaderError from_socket_error (const socket::SocketError &err)
 

Variables

const int64_t UNCHOKE_TIMEOUT = 15
 
const int64_t HANDSHAKE_LENGTH = 1 + 19 + 8 + 20 + 20
 Length (in bytes) of a BitTorrent handshake. More...
 
const int64_t INFO_HASH_OFFSET = 1 + 19 + 8
 

Enumeration Type Documentation

◆ DownloaderError

Enumerator
DifferentInfoHash 

The peer sent back a different info hash when handshaking.

InvalidMessage 

Error decoding a BitTorrent TCP protocol message.

NoBitfield 

The peer didn't send the bitfield as its first message.

MissingPiece 

The peer doesn't have the requested piece.

CorruptPiece 

The piece was correctly downloaded but doesn't match the expected hash.

SocketTimeout 

The socket timed out.

SocketOther 

The socket experienced some other, generic, error.

Function Documentation

◆ from_socket_error()

DownloaderError fur::download::downloader::from_socket_error ( const socket::SocketError err)

Variable Documentation

◆ HANDSHAKE_LENGTH

const int64_t fur::download::downloader::HANDSHAKE_LENGTH = 1 + 19 + 8 + 20 + 20

Length (in bytes) of a BitTorrent handshake.

◆ INFO_HASH_OFFSET

const int64_t fur::download::downloader::INFO_HASH_OFFSET = 1 + 19 + 8

Offset (in bytes) from the beginning of a BitTorrent handshake for the info-hash field.

◆ UNCHOKE_TIMEOUT

const int64_t fur::download::downloader::UNCHOKE_TIMEOUT = 15

Should be greater than 10 seconds for a realistic torrent client but smaller values result in quicker testing