ORE Studio 0.0.4
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
ores::comms::net Namespace Reference

Contains the networking elements of the comms library. More...

Classes

class  client
 ORES protocol client. More...
 
struct  client_options
 Configuration for the client. More...
 
class  client_session
 Client-side session manager providing auth-aware request handling. More...
 
struct  client_session_info
 Information about the client's authenticated session. More...
 
class  connection
 SSL connection wrapper for frame-based communication. More...
 
class  connection_error
 Exception thrown when client connection or handshake fails. More...
 
class  pending_request_map
 Thread-safe map for tracking pending requests by correlation ID. More...
 
class  response_channel
 Single-value async channel for delivering a response frame. More...
 
struct  retry_options
 Configuration for client retry and reconnection behavior. More...
 
class  server
 ORES protocol server. More...
 
struct  server_options
 Configuration for the server. More...
 
class  server_session
 Represents a client session on the server side. More...
 

Typedefs

using disconnect_callback_t = std::function< void()>
 Callback invoked when client detects server disconnect.
 
using reconnecting_callback_t = std::function< void()>
 Callback invoked when client starts reconnection attempts.
 
using reconnected_callback_t = std::function< void()>
 Callback invoked when client successfully reconnects.
 
using notification_callback_t = std::function< void(const std::string &event_type, std::chrono::system_clock::time_point timestamp)>
 Callback invoked when client receives a notification from server.
 
using tcp = boost::asio::ip::tcp
 

Enumerations

enum class  connection_state { disconnected , connecting , connected , reconnecting }
 Connection state for the client. More...
 
enum class  client_session_error {
  not_connected , not_logged_in , login_required , admin_required ,
  request_failed , deserialization_failed , server_error
}
 Error codes specific to client session operations.
 

Functions

std::ostream & operator<< (std::ostream &s, connection_state v)
 
std::ostream & operator<< (std::ostream &s, const retry_options &v)
 
std::ostream & operator<< (std::ostream &s, const client_options &v)
 
std::string to_string (client_session_error error)
 Convert client_session_error to string for display.
 
std::ostream & operator<< (std::ostream &s, const server_options &v)
 

Detailed Description

Contains the networking elements of the comms library.

Defines the client and server, connections and sessions.

Typedef Documentation

◆ disconnect_callback_t

using disconnect_callback_t = std::function<void()>

Callback invoked when client detects server disconnect.

Called from the heartbeat coroutine when ping fails or times out. The callback is invoked on the client's internal executor and should not perform blocking operations. Any UI updates must be dispatched to the appropriate UI thread.

◆ reconnecting_callback_t

using reconnecting_callback_t = std::function<void()>

Callback invoked when client starts reconnection attempts.

Called when connection is lost and auto-reconnect is enabled. Allows UI to show reconnecting state to the user. The callback is invoked on the client's internal executor and should not perform blocking operations. Any UI updates must be dispatched to the appropriate UI thread.

◆ reconnected_callback_t

using reconnected_callback_t = std::function<void()>

Callback invoked when client successfully reconnects.

Called after auto-reconnect succeeds. Allows UI to restore connected state display. The callback is invoked on the client's internal executor and should not perform blocking operations. Any UI updates must be dispatched to the appropriate UI thread.

◆ notification_callback_t

using notification_callback_t = std::function<void( const std::string& event_type, std::chrono::system_clock::time_point timestamp)>

Callback invoked when client receives a notification from server.

Called when the server pushes a notification for a subscribed event type. The callback is invoked on the client's internal executor and should not perform blocking operations. Any UI updates must be dispatched to the appropriate UI thread.

Parameters
event_typeThe fully qualified event type name (e.g., "ores.risk.currency_changed_event")
timestampWhen the event occurred (UTC)

Enumeration Type Documentation

◆ connection_state

enum class connection_state
strong

Connection state for the client.

Enumerator
disconnected 

Not connected to server.

connecting 

Initial connection in progress.

connected 

Connected and ready for requests.

reconnecting 

Lost connection, attempting to reconnect.