cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
|
Class to establish a connection using multiple backends of protocols. More...
#include <msgpack_rpc/transport/async_connect.h>
Public Member Functions | |
MultiBackendConnector (const BackendList &backends, const std::vector< addresses::URI > &uris, std::function< void(const Status &, std::shared_ptr< IConnection >)> on_connection) | |
Constructor. | |
void | operator() (const Status &status, std::shared_ptr< IConnection > connection) |
Handle the result to connect to an endpoint. | |
void | start () |
Start to connect to an endpoint. |
Private Member Functions | |
void | async_connect () |
Asynchronously connect to an endpoint. |
Private Attributes | |
const BackendList * | backends_ |
Backends. | |
std::shared_ptr< IConnector > | connector_ {} |
Current connector. | |
std::vector< addresses::URI >::const_iterator | current_uri_ |
Current URI. | |
std::function< void(Status, std::shared_ptr< IConnection >)> | on_connection_ |
Callback function called when a connection is established or error occurred in all URIs. | |
const std::vector< addresses::URI > * | uris_ |
URIs. |
Class to establish a connection using multiple backends of protocols.
Definition at line 46 of file async_connect.h.
|
inline |
Constructor.
[in] | backends | Backends. |
[in] | uris | URIs. |
[in] | on_connection | Callback function called when a connection is established or error occurred in all URIs. |
Definition at line 56 of file async_connect.h.
|
inlineprivate |
Asynchronously connect to an endpoint.
Definition at line 96 of file async_connect.h.
|
inline |
Handle the result to connect to an endpoint.
[in] | status | Status. |
[in] | connection | Connection. |
Definition at line 76 of file async_connect.h.
|
inline |
Start to connect to an endpoint.
Definition at line 68 of file async_connect.h.
|
private |
Backends.
Definition at line 107 of file async_connect.h.
|
private |
Current connector.
Definition at line 119 of file async_connect.h.
|
private |
Current URI.
Definition at line 116 of file async_connect.h.
|
private |
Callback function called when a connection is established or error occurred in all URIs.
Definition at line 113 of file async_connect.h.
|
private |
URIs.
Definition at line 110 of file async_connect.h.