Furrent
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
fur::download::message::RequestMessage Class Referencefinal

#include <message.hpp>

Inheritance diagram for fur::download::message::RequestMessage:
Inheritance graph
[legend]
Collaboration diagram for fur::download::message::RequestMessage:
Collaboration graph
[legend]

Public Member Functions

 RequestMessage (int64_t index, int64_t begin, int64_t length)
 
MessageKind kind () const override
 
- Public Member Functions inherited from fur::download::message::Message
virtual ~Message ()=default
 
virtual std::vector< uint8_t > encode () const
 

Static Public Member Functions

static Result< std::unique_ptr< RequestMessage >, DecodeErrordecode (const std::vector< uint8_t > &buf)
 
- Static Public Member Functions inherited from fur::download::message::Message
static Result< std::unique_ptr< Message >, DecodeErrordecode (const TorrentFile &torrent, const std::vector< uint8_t > &buf)
 

Public Attributes

const int64_t index
 Index of the piece. More...
 
const int64_t begin
 Offset from the beginning of the piece. More...
 
const int64_t length
 How many bytes we're asking. Typically 16KB. More...
 

Detailed Description

Ask the peer to send us a subset of the bytes in a piece. <length=13><id=6><index><begin><length>

Constructor & Destructor Documentation

◆ RequestMessage()

fur::download::message::RequestMessage::RequestMessage ( int64_t  index,
int64_t  begin,
int64_t  length 
)
inline

Member Function Documentation

◆ decode()

Result< std::unique_ptr< RequestMessage >, DecodeError > fur::download::message::RequestMessage::decode ( const std::vector< uint8_t > &  buf)
static

◆ kind()

MessageKind fur::download::message::RequestMessage::kind ( ) const
inlineoverridevirtual

Returns the kind of this message. Used before dynamic_casting when the underlying type is not known beforehand.

Implements fur::download::message::Message.

Member Data Documentation

◆ begin

const int64_t fur::download::message::RequestMessage::begin

Offset from the beginning of the piece.

◆ index

const int64_t fur::download::message::RequestMessage::index

Index of the piece.

◆ length

const int64_t fur::download::message::RequestMessage::length

How many bytes we're asking. Typically 16KB.


The documentation for this class was generated from the following files: