|
ORE Studio 0.0.4
|
ORES protocol server. More...
#include <server.hpp>
Inherits enable_shared_from_this< server >.

Public Member Functions | |
| server (server_options options, std::shared_ptr< service::subscription_manager > subscription_mgr=nullptr) | |
| Construct server with configuration. | |
| void | register_handler (messaging::message_type_range range, std::shared_ptr< messaging::message_handler > handler) |
| Register a message handler for a range of message types. | |
| std::shared_ptr< service::auth_session_service > | sessions () const |
| Get the shared auth session service. | |
| boost::asio::awaitable< void > | run (boost::asio::io_context &io_context, std::function< void(std::uint16_t)> on_listening=nullptr) |
| Run the server. | |
| void | stop () |
| Stop the server. | |
| void | broadcast_database_status (bool available, const std::string &error_message) |
| Broadcast database status to all connected clients. | |
ORES protocol server.
Accepts SSL connections, performs handshake, and manages client sessions.
|
explicit |
Construct server with configuration.
| options | Server options including port, SSL config, etc. |
| subscription_mgr | Optional subscription manager for event notifications. |
| void register_handler | ( | messaging::message_type_range | range, |
| std::shared_ptr< messaging::message_handler > | handler | ||
| ) |
Register a message handler for a range of message types.
Must be called before run() to register subsystem handlers.
| std::shared_ptr< service::auth_session_service > sessions | ( | ) | const |
Get the shared auth session service.
Use this to pass the auth session service to handlers that need it (e.g., accounts_message_handler for login/logout management).
| boost::asio::awaitable< void > run | ( | boost::asio::io_context & | io_context, |
| std::function< void(std::uint16_t)> | on_listening = nullptr |
||
| ) |
Run the server.
Accepts connections and spawns sessions until stopped.
| io_context | The io_context to run the server on |
| on_listening | Optional callback invoked when server starts listening |
| void stop | ( | ) |
Stop the server.
Stops all active sessions and the accept loop.
| void broadcast_database_status | ( | bool | available, |
| const std::string & | error_message | ||
| ) |
Broadcast database status to all connected clients.
Sends a database_status_notification to all active sessions, regardless of their subscription status.
| available | Whether the database is available. |
| error_message | Error message if unavailable, empty otherwise. |