|
|
template<class State > |
| using | stateful_broker = stateful_actor< State, broker > |
| | Convenience template alias for declaring state-based brokers.
|
| |
|
using | datagram_servant_base = broker_servant< network::datagram_manager, datagram_handle, new_datagram_msg > |
| |
|
using | datagram_servant_ptr = intrusive_ptr< datagram_servant > |
| |
|
using | doorman_base = broker_servant< network::acceptor_manager, accept_handle, new_connection_msg > |
| |
|
using | doorman_ptr = intrusive_ptr< doorman > |
| |
|
using | scribe_ptr = intrusive_ptr< scribe > |
| |
| using | middleman_actor = typed_actor< replies_to< publish_atom, uint16_t, strong_actor_ptr, std::set< std::string >, std::string, bool > ::with< uint16_t >, replies_to< publish_udp_atom, uint16_t, strong_actor_ptr, std::set< std::string >, std::string, bool > ::with< uint16_t >, replies_to< open_atom, uint16_t, std::string, bool > ::with< uint16_t >, replies_to< connect_atom, std::string, uint16_t > ::with< node_id, strong_actor_ptr, std::set< std::string > >, replies_to< contact_atom, std::string, uint16_t > ::with< node_id, strong_actor_ptr, std::set< std::string > >, reacts_to< unpublish_atom, actor_addr, uint16_t >, reacts_to< unpublish_udp_atom, actor_addr, uint16_t >, reacts_to< close_atom, uint16_t >, replies_to< spawn_atom, node_id, std::string, message, std::set< std::string > > ::with< strong_actor_ptr >, replies_to< get_atom, node_id >::with< node_id, std::string, uint16_t > > |
| | A message passing interface for asynchronous networking operations. More...
|
| |
|
using | scribe_base = broker_servant< network::stream_manager, connection_handle, new_data_msg > |
| |
|
| enum | receive_policy_flag : unsigned {
at_least,
at_most,
exactly
} |
| |
|
|
expected< void > | close (actor_system &sys, uint16_t port) |
| | Closes port port regardless of whether an actor is published to it.
|
| |
| expected< node_id > | connect (actor_system &sys, std::string host, uint16_t port) |
| | Tries to connect to given node. More...
|
| |
|
behavior | datagram_connection_broker (broker *self, uint16_t port, network::address_listing addresses, actor system_broker) |
| |
|
behavior | connection_helper (stateful_actor< connection_helper_state > *self, actor b) |
| |
| expected< uint16_t > | open (actor_system &sys, uint16_t port, const char *in=nullptr, bool reuse=false) |
| | Tries to open a port for other CAF instances to connect to. More...
|
| |
| template<class Handle > |
| expected< uint16_t > | publish (const Handle &whom, uint16_t port, const char *in=nullptr, bool reuse=false) |
| | Tries to publish whom at port and returns either an error or the bound port. More...
|
| |
| template<class Handle > |
| expected< void > | unpublish (const Handle &whom, uint16_t port=0) |
| | Unpublishes whom by closing port or all assigned ports if port == 0. More...
|
| |
|
std::string | to_string (receive_policy_flag x) |
| |
| template<class ActorHandle = actor> |
| expected< ActorHandle > | remote_actor (actor_system &sys, std::string host, uint16_t port) |
| | Establish a new connection to the actor at host on given port. More...
|
| |
|
expected< group > | remote_group (actor_system &sys, const std::string &group_uri) |
| |
|
expected< group > | remote_group (actor_system &sys, const std::string &group_identifier, const std::string &host, uint16_t port) |
| |
|
template<class Inspector > |
| Inspector::result_type | inspect (Inspector &f, new_connection_msg &x) |
| |
|
|
constexpr invalid_accept_handle_t | invalid_accept_handle = invalid_accept_handle_t{} |
| |
|
constexpr invalid_connection_handle_t | invalid_connection_handle = invalid_connection_handle_t{} |
| |
|
constexpr invalid_datagram_handle_t | invalid_datagram_handle = invalid_datagram_handle_t{} |
| |
Contains all IO-related classes and functions.
◆ middleman_actor
| using caf::io::middleman_actor = typedef typed_actor< replies_to<publish_atom, uint16_t, strong_actor_ptr, std::set<std::string>, std::string, bool> ::with<uint16_t>, replies_to<publish_udp_atom, uint16_t, strong_actor_ptr, std::set<std::string>, std::string, bool> ::with<uint16_t>, replies_to<open_atom, uint16_t, std::string, bool> ::with<uint16_t>, replies_to<connect_atom, std::string, uint16_t> ::with<node_id, strong_actor_ptr, std::set<std::string> >, replies_to<contact_atom, std::string, uint16_t> ::with<node_id, strong_actor_ptr, std::set<std::string> >, reacts_to<unpublish_atom, actor_addr, uint16_t>, reacts_to<unpublish_udp_atom, actor_addr, uint16_t>, reacts_to<close_atom, uint16_t>, replies_to<spawn_atom, node_id, std::string, message, std::set<std::string> > ::with<strong_actor_ptr>, replies_to<get_atom, node_id>::with<node_id, std::string, uint16_t> > |
A message passing interface for asynchronous networking operations.
The interface implements the following pseudo code.
set<string> ifs, string addr, bool reuse_addr)
-> (uint16_t)
(
open_atom, uint16_t port,
string addr,
bool reuse_addr)
-> (uint16_t)
-> (node_id nid, strong_actor_ptr
remote_actor, set<string> ifs)
-> void
-> void
-> void
(
spawn_atom, node_id nid,
string name, message args)
-> (strong_actor_ptr, set<string>)
}
◆ connect()
Tries to connect to given node.
- Attention
- This feature is experimental.
◆ open()
| expected<uint16_t> caf::io::open |
( |
actor_system & |
sys, |
|
|
uint16_t |
port, |
|
|
const char * |
in = nullptr, |
|
|
bool |
reuse = false |
|
) |
| |
Tries to open a port for other CAF instances to connect to.
- Attention
- This feature is experimental.
◆ publish()
template<class Handle >
| expected<uint16_t> caf::io::publish |
( |
const Handle & |
whom, |
|
|
uint16_t |
port, |
|
|
const char * |
in = nullptr, |
|
|
bool |
reuse = false |
|
) |
| |
Tries to publish whom at port and returns either an error or the bound port.
- Parameters
-
| whom | Actor that should be published at port. |
| port | Unused TCP port. |
| in | The IP address to listen to or INADDR_ANY if in == nullptr. |
| reuse | Create socket using SO_REUSEADDR. |
- Returns
- The actual port the OS uses after
bind(). If port == 0 the OS chooses a random high-level port.
◆ remote_actor()
template<class ActorHandle = actor>
Establish a new connection to the actor at host on given port.
- Parameters
-
| host | Valid hostname or IP address. |
| port | TCP port. |
- Returns
- An
actor to the proxy instance representing a remote actor or an error.
◆ unpublish()
template<class Handle >
| expected< void > caf::io::unpublish |
( |
const Handle & |
whom, |
|
|
uint16_t |
port = 0 |
|
) |
| |
Unpublishes whom by closing port or all assigned ports if port == 0.
- Parameters
-
| whom | Actor that should be unpublished at port. |
| port | TCP port. |
expected< ActorHandle > remote_actor(actor_system &sys, std::string host, uint16_t port)
Establish a new connection to the actor at host on given port.
Definition: remote_actor.hpp:67
typed_actor< replies_to< publish_atom, uint16_t, strong_actor_ptr, std::set< std::string >, std::string, bool > ::with< uint16_t >, replies_to< publish_udp_atom, uint16_t, strong_actor_ptr, std::set< std::string >, std::string, bool > ::with< uint16_t >, replies_to< open_atom, uint16_t, std::string, bool > ::with< uint16_t >, replies_to< connect_atom, std::string, uint16_t > ::with< node_id, strong_actor_ptr, std::set< std::string > >, replies_to< contact_atom, std::string, uint16_t > ::with< node_id, strong_actor_ptr, std::set< std::string > >, reacts_to< unpublish_atom, actor_addr, uint16_t >, reacts_to< unpublish_udp_atom, actor_addr, uint16_t >, reacts_to< close_atom, uint16_t >, replies_to< spawn_atom, node_id, std::string, message, std::set< std::string > > ::with< strong_actor_ptr >, replies_to< get_atom, node_id >::with< node_id, std::string, uint16_t > > middleman_actor
A message passing interface for asynchronous networking operations.
Definition: middleman_actor.hpp:152