Furrent
Public Member Functions | List of all members
fur::download::message::KeepAliveMessage Class Referencefinal

#include <message.hpp>

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

Public Member Functions

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

Additional Inherited Members

- 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)
 

Detailed Description

Periodically sent to keep the socket alive. <length=0> (no id) Because this is the only message with no ID, we override the encode function in its entirety, instead of only overriding encode_payload.

Member Function Documentation

◆ encode()

std::vector<uint8_t> fur::download::message::KeepAliveMessage::encode ( ) const
inlineoverridevirtual

This message type is encoded slightly differently than other messages (there's no ID) so we use a custom encoding function.

Reimplemented from fur::download::message::Message.

◆ kind()

MessageKind fur::download::message::KeepAliveMessage::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.


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