filesaver
filesaver::statsd::UDPSender Class Referencefinal

#include <UDPSender.h>

Public Member Functions

Constructor and destructor
 UDPSender (std::string host, const uint16_t port, const std::optional< uint64_t > batchsize=std::nullopt) noexcept
 Constructor. More...
 
 ~UDPSender ()
 Destructor. More...
 
Methods
void setConfig (const std::string &host, const uint16_t port) noexcept
 Sets a configuration { host, port }. More...
 
void send (const std::string &message) noexcept
 Send a message. More...
 
std::optional< std::string > errorMessage () const noexcept
 Returns the error message as an optional string. More...
 

Detailed Description

UDP sender

A simple UDP sender handling batching. Its configuration can be changed at runtime for more flexibility.

Definition at line 47 of file UDPSender.h.

Constructor & Destructor Documentation

◆ UDPSender()

filesaver::statsd::UDPSender::UDPSender ( std::string  host,
const uint16_t  port,
const std::optional< uint64_t >  batchsize = std::nullopt 
)
noexcept

Constructor.

Definition at line 28 of file UDPSender.cpp.

◆ ~UDPSender()

filesaver::statsd::UDPSender::~UDPSender ( )

Destructor.

Definition at line 65 of file UDPSender.cpp.

Member Function Documentation

◆ errorMessage()

std::optional< std::string > filesaver::statsd::UDPSender::errorMessage ( ) const
noexcept

Returns the error message as an optional string.

Definition at line 115 of file UDPSender.cpp.

◆ send()

void filesaver::statsd::UDPSender::send ( const std::string &  message)
noexcept

Send a message.

Definition at line 94 of file UDPSender.cpp.

◆ setConfig()

void filesaver::statsd::UDPSender::setConfig ( const std::string &  host,
const uint16_t  port 
)
noexcept

Sets a configuration { host, port }.

Definition at line 80 of file UDPSender.cpp.


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