Class SendMessageUnbufferedCopy

Inheritance Relationships

Base Type

Class Documentation

class SendMessageUnbufferedCopy : 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. The message is copied so that the user does not have to guarantee the lifetime of the data.

Public Functions

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

Constructs a SendMessageUnbufferedCopy 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

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

Constructs a SendMessageUnbufferedCopy 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