fascade class for sending network messages
More...
#include <Sender.hpp>
|
template<typename Message , typename T , typename Enabled = typename std::enable_if<std::is_integral<T>::value, void>::type> |
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...
|
|
bool | requestReply (RequestT &&request, ReplyContext &ctx, ReplyHandler &replyHandler, time::Duration timeout=time::Duration::seconds(0xffffffff)) |
| The caller is blocked until the replies to this request are heard and processed. Just like regular Messages REQUEST is sent out to Clients through the CcSender. More...
|
|
void | sendReply (REPLY< M > &&reply) |
| part of synchronous request reply interface. Send a constructed REPLY using the CcSender, it will only reach to the origianl sender Client. ALL REPLY via a Sender need to sent out using this interface to avoid undefined behavior. More...
|
|
void | sendReply (REPLY< M > const &reply) |
| part of synchronous request reply interface. Send a constructed REPLY using the CcSender, it will only reach to the origianl sender Client. ALL REPLY via a Sender need to sent out using this interface to avoid undefined behavior. More...
|
|
fascade class for sending network messages
template<typename Message , typename T , typename Enabled = typename std::enable_if<std::is_integral<T>::value, void>::type>
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: