fascade class for sending network messages
More...
#include <Sender.hpp>
|
using | ptr = std::shared_ptr< Sender > |
|
|
template<typename Message , typename T , typename = enable_if<is_integral<T>::value>> |
void | send (Message &&msg, T len) |
| send a message's first bytes More...
|
|
template<typename... Messages> |
void | send (Messages &&...msgs) |
| send a batch of message asynchronizely More...
|
|
template<typename... Messages> |
bool | trySend (Messages &&...msgs) |
| try to send a batch of message asynchronizely More...
|
|
template<typename Message , typename... Args> |
void | sendInPlace (Args &&...args) |
| send a message asynchronizely - avoiding Message copying by directly constructing the message in the buffer More...
|
|
void | sendBytes (uint16_t tag, void const *bytes, size_t len) |
| send a message asynchronizely by providing message in tag and bytes More...
|
|
fascade class for sending network messages
template<typename Message , typename T , typename = enable_if<is_integral<T>::value>>
void hmbdc::app::tcpcast::Sender::send |
( |
Message && |
msg, |
|
|
T |
len |
|
) |
| |
|
inline |
send a message's first bytes
the bytes length could be larger than Message, but needs to be able to fit in the tansport buffer the sender is associated with - exception thrown otherwise
- Parameters
-
- Template Parameters
-
- Parameters
-
len | just send the first len bytes of this message |
- Template Parameters
-
template<typename... Messages>
void hmbdc::app::tcpcast::Sender::send |
( |
Messages &&... |
msgs | ) |
|
|
inline |
send a batch of message asynchronizely
although batching could implicitly happen further performance gain could be achieved by sending more msg in a batch here
- Parameters
-
- Template Parameters
-
void hmbdc::app::tcpcast::Sender::sendBytes |
( |
uint16_t |
tag, |
|
|
void const * |
bytes, |
|
|
size_t |
len |
|
) |
| |
|
inline |
send a message asynchronizely by providing message in tag and bytes
for runtime typed usage when the message type can only be decided at runtime
- Parameters
-
tag | message tag |
bytes | message byte starting address |
len | byte length of the above |
template<typename Message , typename... Args>
void hmbdc::app::tcpcast::Sender::sendInPlace |
( |
Args &&... |
args | ) |
|
|
inline |
send a message asynchronizely - avoiding Message copying by directly constructing the message in the buffer
- Parameters
-
args | Message's ctor args to construct the Message in the buffer |
- Template Parameters
-
Message | Type |
typename | ... Args args type |
template<typename... Messages>
bool hmbdc::app::tcpcast::Sender::trySend |
( |
Messages &&... |
msgs | ) |
|
|
inline |
try to send a batch of message asynchronizely
this call does not block and it is transactional - all or none is queued
- Parameters
-
- Template Parameters
-
- Returns
- true if the messages are queued successfully in bufffer
The documentation for this struct was generated from the following file: