Go to the documentation of this file.
11 #include "tfriend_fw.hpp"
75 std::optional<Socket> socket;
85 std::optional<Bitfield> bitfield;
103 void destroy_socket();
106 friend TestingFriend;
DownloaderError
Definition: downloader.hpp:32
@ DifferentInfoHash
The peer sent back a different info hash when handshaking.
Definition: downloader.cpp:13
@ CorruptPiece
The piece was correctly downloaded but doesn't match the expected hash.
int64_t index
Definition: downloader.hpp:24
SocketError
Definition: socket.hpp:15
Used to handle errors without using exceptions.
Definition: result.hpp:18
@ NoBitfield
The peer didn't send the bitfield as its first message.
std::chrono::steady_clock::duration timeout
Definition: socket.hpp:13
A downloaded piece for a torrent file.
Definition: downloader.hpp:23
@ MissingPiece
The peer doesn't have the requested piece.
Definition: downloader.hpp:54
Represents a single peer as given by the tracker.
Definition: peer.hpp:19
Definition: bitfield.cpp:24
Represents a parsed .torrent file.
Definition: torrent.hpp:32
DownloaderError from_socket_error(const socket::SocketError &err)
Definition: downloader.cpp:18
@ InvalidMessage
Error decoding a BitTorrent TCP protocol message.
@ SocketOther
The socket experienced some other, generic, error.
@ SocketTimeout
The socket timed out.
std::vector< uint8_t > content
Definition: downloader.hpp:25
Definition: message.hpp:46
Definition: message.cpp:9
Definition: torrent.hpp:75
Definition: result.hpp:12