Loading...
Searching...
No Matches
caf::io::basp Namespace Reference

Contains all classes and functions for the Binary Actor Sytem Protocol. More...

## Classes

struct | header
| The header of a Binary Actor System Protocol (BASP) message. More...
class | instance
| Describes a protocol instance managing multiple connections. More...
class | message_queue
| Enforces strict order of message delivery, i.e., deliver messages in the same order as if they were deserialized by a single thread. More...
class | routing_table
| Stores routing information for a single broker participating as BASP peer and provides both direct and indirect paths. More...
class | worker
| Deserializes payloads for BASP messages asynchronously. More...

## Typedefs

using | buffer_type = std::vector<char>
| Storage type for raw bytes.

## Enumerations

enum | connection_state { await_header , await_payload , close_connection , incompatible_versions , incompatible_application_ids , malformed_basp_message , serializing_basp_payload_failed , redundant_connection , no_route_to_receiving_node }
| Denotes the state of a connection between two BASP nodes. More...
enum class | message_type : uint8_t { server_handshake = 0x00 , client_handshake = 0x01 , direct_message = 0x02 , routed_message = 0x03 , monitor_message = 0x04 , down_message = 0x05 , heartbeat = 0x06 }
| Describes the first header field of a BASP message and determines the interpretation of the other header fields. More...

## Functions

bool | is_handshake (const header &hdr)
| Checks whether given header contains a handshake.
bool | is_heartbeat (const header &hdr)
| Checks wheter given header contains a heartbeat.
template<class Inspector>
Inspector::result_type | inspect (Inspector &f, header &hdr)
bool | operator== (const header &lhs, const header &rhs)
bool | operator!= (const header &lhs, const header &rhs)
bool | valid (const header &hdr)
| Checks whether given BASP header is valid.

## Variables

constexpr size_t | header_size
| Size of a BASP header in serialized form.
constexpr uint64_t | version = 3
| The current BASP version. Note: BASP is not backwards compatible.

## Detailed Description

Contains all classes and functions for the Binary Actor Sytem Protocol.

## Enumeration Type Documentation

## connection_state

enum caf::io::basp::connection_state

Denotes the state of a connection between two BASP nodes.

Overlaps with sec (these states get converted to an error by the BASP instance).

Enumerator
await_header | Indicates that a connection is established and this node is waiting for the next BASP header.
await_payload | Indicates that this node has received a header with non-zero payload and is waiting for the data.
close_connection | Indicates that this connection no longer exists.
incompatible_versions | See sec::incompatible_versions.
incompatible_application_ids | See sec::incompatible_application_ids.
malformed_basp_message | See sec::malformed_basp_message.
serializing_basp_payload_failed | See sec::serializing_basp_payload_failed.
redundant_connection | See sec::redundant_connection.
no_route_to_receiving_node | See sec::no_route_to_receiving_node.

## message_type

enum class caf::io::basp::message_type : uint8_t

strong

Describes the first header field of a BASP message and determines the interpretation of the other header fields.

Enumerator
server_handshake | Send from server, i.e., the node with a published actor, to client, i.e., node that initiates a new connection using remote_actor().
client_handshake | Send from client to server after it has successfully received the server_handshake to establish the connection.
direct_message | Transmits a direct message from source to destination.
routed_message | Transmits a message from source_node:source_actor to dest_node:dest_actor.
monitor_message | Informs the receiving node that the sending node has created a proxy instance for one of its actors. Causes the receiving node to attach a functor to the actor that triggers a down_message on termination.
down_message | Informs the receiving node that it has a proxy for an actor that has been terminated.
heartbeat | Used to generate periodic traffic between two nodes in order to detect disconnects.

## Variable Documentation

## header_size

size_t caf::io::basp::header_size

constexpr

Initial value:
= sizeof(actor_id) * 2
+ sizeof(uint32_t) * 2
+ sizeof(uint64_t)

Size of a BASP header in serialized form.