|
roo_transport
API Documentation for roo_transport
|
Abstract interface for message exchange over a reliable channel. More...
#include <messaging.h>
Data Structures | |
| class | Receiver |
| class | SimpleReceiver |
Public Types | |
| using | ConnectionId = uint32_t |
Public Member Functions | |
| virtual | ~Messaging ()=default |
| void | setReceiver (Receiver &receiver) |
| Registers message receiver. Call before channel initialization. | |
| void | unsetReceiver () |
| Unregisters receiver. | |
| virtual bool | send (const roo::byte *header, size_t header_size, const roo::byte *payload, size_t payload_size, ConnectionId *connection_id)=0 |
| Sends message with optional header and payload. | |
| virtual bool | sendContinuation (ConnectionId connection_id, const roo::byte *header, size_t header_size, const roo::byte *payload, size_t payload_size)=0 |
| Sends continuation payload on an existing sender-side connection. | |
| virtual bool | send (const roo::byte *payload, size_t payload_size, ConnectionId *connection_id) |
| Convenience overload for header-less messages. | |
| bool | send (const roo::byte *payload, size_t payload_size) |
| Convenience overload for header-less stateless messages. | |
| virtual bool | sendContinuation (ConnectionId connection_id, const roo::byte *payload, size_t payload_size) |
| Convenience overload for header-less continuation messages. | |
Protected Member Functions | |
| Messaging ()=default | |
| void | received (ConnectionId connection_id, const roo::byte *data, size_t len) |
| Dispatches received message to registered receiver. | |
| void | reset (ConnectionId connection_id) |
| Dispatches reset notification to registered receiver. | |
Abstract interface for message exchange over a reliable channel.
Messages are arbitrary-length byte arrays with in-order, integrity-checked delivery. Messages may be lost across channel reset/reconnect boundaries.
Definition at line 17 of file messaging.h.
Definition at line 19 of file messaging.h.
|
virtualdefault |
|
protecteddefault |
|
protected |
Dispatches received message to registered receiver.
Definition at line 5 of file messaging.cpp.
References roo_transport::Messaging::Receiver::received().
|
protected |
Dispatches reset notification to registered receiver.
Definition at line 12 of file messaging.cpp.
References roo_transport::Messaging::Receiver::reset().
|
pure virtual |
Sends message with optional header and payload.
| connection_id | Optional out parameter receiving sender-side connection id used for this send. |
Implemented in roo_transport::LinkMessaging, roo_transport::MuxMessaging::Channel, roo_transport::LinkMessaging, and roo_transport::MuxMessaging::Channel.
Referenced by roo_transport::MuxMessaging::Channel::send(), send(), send(), roo_transport::RpcClient::sendUnaryRpc(), and roo_transport::RpcClient::sendUnaryRpcWithTimeout().
Convenience overload for header-less stateless messages.
Definition at line 57 of file messaging.h.
References send().
|
inlinevirtual |
Convenience overload for header-less messages.
Reimplemented in roo_transport::LinkMessaging, and roo_transport::MuxMessaging::Channel.
Definition at line 51 of file messaging.h.
References send().
|
pure virtual |
Sends continuation payload on an existing sender-side connection.
Intended for connection-affine responses (e.g. RPC) and atomic message streams.
Implemented in roo_transport::LinkMessaging, roo_transport::MuxMessaging::Channel, roo_transport::LinkMessaging, and roo_transport::MuxMessaging::Channel.
Referenced by roo_transport::MuxMessaging::Channel::sendContinuation(), and sendContinuation().
|
inlinevirtual |
Convenience overload for header-less continuation messages.
Reimplemented in roo_transport::LinkMessaging, and roo_transport::MuxMessaging::Channel.
Definition at line 62 of file messaging.h.
References sendContinuation().
Registers message receiver. Call before channel initialization.
Definition at line 27 of file messaging.h.
Referenced by roo_transport::RpcClient::begin(), roo_transport::RpcServer::begin(), and roo_transport::MuxMessaging::MuxMessaging().
|
inline |
Unregisters receiver.
Definition at line 30 of file messaging.h.
Referenced by roo_transport::RpcClient::end(), roo_transport::RpcServer::end(), and roo_transport::RpcServer::~RpcServer().