Class SendMessageUnbuffered

Inheritance Relationships

Base Type

Class Documentation

class SendMessageUnbuffered : public netio3::asyncmsg::SendMessage

Represents an unbuffered message to be sent.

This class is derived from the SendMessage base class and provides functionality to send an unbuffered message over a TCP connection.

Public Functions

SendMessageUnbuffered(std::span<const std::uint8_t> data, std::span<const std::uint8_t> header_data, std::uint64_t key)

Constructs a SendMessageUnbuffered object with the given data.

Parameters:
  • data – The message data to be sent

  • header_data – The header data to be prepended

  • key – The key to be returned on the on_send_competed callback

SendMessageUnbuffered(std::span<const iovec> data, std::span<const std::uint8_t> header_data, std::uint64_t key)

Constructs a SendMessageUnbuffered object with the given data.

Parameters:
  • data – The message data to be sent

  • header_data – The header data to be prepended

  • key – The key to be returned on the on_send_competed callback

virtual void toBuffers(std::vector<boost::asio::const_buffer> &buffers) const override

Converts the message data into a vector of boost::asio::const_buffer objects.

This function is overridden from the base class and populates the given vector with const_buffer objects representing the message data. The header data is prepended to the message data.

Parameters:

buffers – The vector to be populated with const_buffer objects

inline virtual std::uint64_t key() const override

Retrieves the key of the message.

This method returns the key associated with the message being sent.

Returns:

The key of the message