|
ORE Studio 0.0.4
|
ORES protocol client. More...
#include <client.hpp>

Public Member Functions | |
| client (client_options config, std::shared_ptr< eventing::service::event_bus > event_bus=nullptr) | |
| Construct client with configuration. | |
| client (client_options config, boost::asio::any_io_executor executor, std::shared_ptr< eventing::service::event_bus > event_bus=nullptr) | |
| Construct client with configuration and executor. | |
| ~client () | |
| Destructor. | |
| boost::asio::awaitable< void > | connect () |
| Connect to server and perform handshake (async version). | |
| void | connect_sync () |
| Connect to server and perform handshake (blocking version). | |
| boost::asio::awaitable< void > | connect_with_retry () |
| Connect to server with retry (async version). | |
| void | connect_with_retry_sync () |
| Connect to server with retry (blocking version). | |
| void | disconnect () |
| Disconnect from server. | |
| bool | is_connected () const |
| Check if client is connected. | |
| connection_state | get_state () const |
| Get the current connection state. | |
| void | set_disconnect_callback (disconnect_callback_t callback) |
| Set callback to be invoked when disconnect is detected. | |
| void | set_reconnecting_callback (reconnecting_callback_t callback) |
| Set callback to be invoked when reconnection starts. | |
| void | set_reconnected_callback (reconnected_callback_t callback) |
| Set callback to be invoked when reconnection succeeds. | |
| void | set_notification_callback (notification_callback_t callback) |
| Set callback to be invoked when a notification is received. | |
| boost::asio::awaitable< std::expected< messaging::frame, messaging::error_code > > | send_request (messaging::frame request_frame) |
| Send a request frame and receive response frame (async version). | |
| std::expected< messaging::frame, messaging::error_code > | send_request_sync (messaging::frame request_frame) |
| Send a request frame and receive response frame (blocking version). | |
ORES protocol client.
Connects to server via SSL, performs handshake, and manages communication.
|
explicit |
Construct client with configuration.
Creates its own io_context for synchronous operations.
| config | Client configuration options |
| event_bus | Optional event bus for publishing connection events |
|
explicit |
Construct client with configuration and executor.
| config | Client configuration options |
| executor | The executor to use for async operations |
| event_bus | Optional event bus for publishing connection events |
| ~client | ( | ) |
Destructor.
Ensures proper cleanup order - strand and pending requests must be destroyed before the io_context they reference.
| boost::asio::awaitable< void > connect | ( | ) |
Connect to server and perform handshake (async version).
Single attempt connection without retries.
| connection_error | if connection or handshake fails |

| void connect_sync | ( | ) |
Connect to server and perform handshake (blocking version).
Single attempt connection without retries.
| connection_error | if connection or handshake fails |
| boost::asio::awaitable< void > connect_with_retry | ( | ) |
Connect to server with retry (async version).
Attempts connection with exponential backoff according to retry_options.
| connection_error | if all retry attempts fail |

| void connect_with_retry_sync | ( | ) |
Connect to server with retry (blocking version).
Attempts connection with exponential backoff according to retry_options.
| connection_error | if all retry attempts fail |
| bool is_connected | ( | ) | const |
Check if client is connected.
Returns true only when in the connected state, not during reconnection.
| void set_disconnect_callback | ( | disconnect_callback_t | callback | ) |
Set callback to be invoked when disconnect is detected.
The callback will be called from the heartbeat coroutine when a ping fails or times out. It should be thread-safe.
| callback | Function to call on disconnect (may be empty to disable) |
| void set_reconnecting_callback | ( | reconnecting_callback_t | callback | ) |
Set callback to be invoked when reconnection starts.
The callback will be called when auto-reconnect begins after connection loss. It should be thread-safe.
| callback | Function to call on reconnection start (may be empty to disable) |
| void set_reconnected_callback | ( | reconnected_callback_t | callback | ) |
Set callback to be invoked when reconnection succeeds.
The callback will be called after auto-reconnect successfully restores the connection. It should be thread-safe.
| callback | Function to call on reconnection success (may be empty to disable) |
| void set_notification_callback | ( | notification_callback_t | callback | ) |
Set callback to be invoked when a notification is received.
The callback will be called when the server pushes a notification for an event type the client is subscribed to. It should be thread-safe.
| callback | Function to call on notification (may be empty to disable) |
| boost::asio::awaitable< std::expected< messaging::frame, messaging::error_code > > send_request | ( | messaging::frame | request_frame | ) |
Send a request frame and receive response frame (async version).
Generic method for sending any request and receiving response. Manages sequence numbers automatically.
| request_frame | The request frame to send |

| std::expected< messaging::frame, messaging::error_code > send_request_sync | ( | messaging::frame | request_frame | ) |
Send a request frame and receive response frame (blocking version).
Generic method for sending any request and receiving response. Manages sequence numbers automatically.
| request_frame | The request frame to send |