libcaf
0.15.5
|
A wrapper for the boost::asio multiplexer. More...
#include <asio_multiplexer.hpp>
Public Member Functions | |
scribe_ptr | new_scribe (asio_tcp_socket &&sock) |
scribe_ptr | new_scribe (native_socket fd) override |
Creates a new scribe from a native socket handle. More... | |
expected< scribe_ptr > | new_tcp_scribe (const std::string &host, uint16_t port) override |
Tries to connect to host on given port and returns a scribe instance on success. More... | |
doorman_ptr | new_doorman (asio_tcp_socket_acceptor &&sock) |
doorman_ptr | new_doorman (native_socket fd) override |
Creates a new doorman from a native socket handle. More... | |
expected< doorman_ptr > | new_tcp_doorman (uint16_t port, const char *in, bool reuse_addr) override |
Tries to create an unbound TCP doorman bound to port , optionally accepting only connections from IP address in . More... | |
datagram_servant_ptr | new_datagram_servant (native_socket fd) override |
Creates a new datagram_servant from a native socket handle. More... | |
datagram_servant_ptr | new_datagram_servant_for_endpoint (native_socket fd, const ip_endpoint &ep) override |
expected< datagram_servant_ptr > | new_remote_udp_endpoint (const std::string &host, uint16_t port) override |
Create a new datagram_servant to contact a remote endpoint host and port . More... | |
expected< datagram_servant_ptr > | new_local_udp_endpoint (uint16_t port, const char *in=nullptr, bool reuse_addr=false) override |
Create a new datagram_servant that receives datagrams on the local port , optionally only accepting connections from IP address in . More... | |
void | exec_later (resumable *ptr) override |
Enqueues ptr to the job list of the execution unit. More... | |
asio_multiplexer (actor_system *sys) | |
supervisor_ptr | make_supervisor () override |
Creates a supervisor to keep the event loop running. | |
bool | try_run_once () override |
Exectutes all pending events without blocking. More... | |
void | run_once () override |
Runs at least one event and blocks if needed. | |
void | run () override |
Runs events until all connection are closed. | |
multiplexer_backend * | pimpl () override |
Retrieves a pointer to the implementation or nullptr if CAF was compiled using the default backend. More... | |
boost::asio::io_service & | service () |
![]() | |
multiplexer (actor_system *sys) | |
template<class F > | |
void | dispatch (F fun) |
Invokes fun in the multiplexer's event loop, calling fun() immediately when called from inside the event loop. More... | |
template<class F > | |
void | post (F fun) |
Invokes fun in the multiplexer's event loop, forcing execution to be delayed when called from inside the event loop. More... | |
const std::thread::id & | thread_id () const |
void | thread_id (std::thread::id tid) |
![]() | |
execution_unit (actor_system *sys) | |
execution_unit (execution_unit &&)=delete | |
execution_unit (const execution_unit &)=delete | |
actor_system & | system () const |
Returns the enclosing actor system. More... | |
proxy_registry * | proxy_registry_ptr () |
Returns a pointer to the proxy factory currently associated to this unit. | |
void | proxy_registry_ptr (proxy_registry *ptr) |
Associated a new proxy factory to this unit. | |
Friends | |
class | io::middleman |
class | supervisor |
Additional Inherited Members | |
![]() | |
using | supervisor_ptr = std::unique_ptr< supervisor > |
![]() | |
static std::unique_ptr< multiplexer > | make (actor_system &sys) |
Creates an instance using the networking backend compiled with CAF. | |
![]() | |
std::thread::id | tid_ |
Identifies the thread this multiplexer is running in. More... | |
![]() | |
actor_system * | system_ |
proxy_registry * | proxies_ |
A wrapper for the boost::asio multiplexer.
|
overridevirtual |
Enqueues ptr
to the job list of the execution unit.
Implements caf::execution_unit.
|
overridevirtual |
Creates a new datagram_servant
from a native socket handle.
Implements caf::io::network::multiplexer.
|
overridevirtual |
Creates a new doorman from a native socket handle.
Implements caf::io::network::multiplexer.
|
overridevirtual |
Create a new datagram_servant
that receives datagrams on the local port
, optionally only accepting connections from IP address in
.
Implements caf::io::network::multiplexer.
|
overridevirtual |
Create a new datagram_servant
to contact a remote endpoint host
and port
.
Implements caf::io::network::multiplexer.
|
overridevirtual |
Creates a new scribe
from a native socket handle.
Implements caf::io::network::multiplexer.
|
overridevirtual |
Tries to create an unbound TCP doorman bound to port
, optionally accepting only connections from IP address in
.
Implements caf::io::network::multiplexer.
|
overridevirtual |
Tries to connect to host
on given port
and returns a scribe
instance on success.
Implements caf::io::network::multiplexer.
|
overridevirtual |
Retrieves a pointer to the implementation or nullptr
if CAF was compiled using the default backend.
Reimplemented from caf::io::network::multiplexer.
|
overridevirtual |
Exectutes all pending events without blocking.
true
if at least one event was called, false
otherwise. Implements caf::io::network::multiplexer.