|
ORE Studio 0.0.4
|
SSL connection wrapper for frame-based communication. More...
#include <connection.hpp>

Public Types | |
| using | ssl_socket = boost::asio::ssl::stream< boost::asio::ip::tcp::socket > |
Public Member Functions | |
| connection (ssl_socket socket) | |
| Construct connection from an SSL socket. | |
| boost::asio::awaitable< void > | ssl_handshake_server (boost::asio::cancellation_slot cancel_slot={}) |
| Perform SSL handshake as server. | |
| boost::asio::awaitable< void > | ssl_handshake_client (boost::asio::cancellation_slot cancel_slot={}) |
| Perform SSL handshake as client. | |
| boost::asio::awaitable< std::expected< messaging::frame, messaging::error_code > > | read_frame (bool skip_version_check=false, boost::asio::cancellation_slot cancel_slot={}) |
| Read a complete frame from the connection. | |
| boost::asio::awaitable< void > | write_frame (const messaging::frame &frame, boost::asio::cancellation_slot cancel_slot={}) |
| Write a frame to the connection. | |
| bool | is_open () const |
| Check if the connection is open. | |
| void | close () |
| Close the connection. | |
| std::string | remote_address () const |
| Get the remote endpoint address. | |
SSL connection wrapper for frame-based communication.
Provides async read/write operations for protocol frames over SSL/TLS.
| boost::asio::awaitable< void > ssl_handshake_server | ( | boost::asio::cancellation_slot | cancel_slot = {} | ) |
Perform SSL handshake as server.
| cancel_slot | Optional cancellation slot for graceful shutdown |
| boost::asio::awaitable< void > ssl_handshake_client | ( | boost::asio::cancellation_slot | cancel_slot = {} | ) |
Perform SSL handshake as client.
| cancel_slot | Optional cancellation slot for graceful shutdown |
| boost::asio::awaitable< std::expected< messaging::frame, messaging::error_code > > read_frame | ( | bool | skip_version_check = false, |
| boost::asio::cancellation_slot | cancel_slot = {} |
||
| ) |
Read a complete frame from the connection.
Reads the frame header first, then reads the payload based on the size specified in the header.
| skip_version_check | If true, skips protocol version validation. This is useful during handshake to allow the server to send a proper version mismatch response instead of rejecting the frame immediately. |
| cancel_slot | Optional cancellation slot for graceful shutdown |
| boost::asio::awaitable< void > write_frame | ( | const messaging::frame & | frame, |
| boost::asio::cancellation_slot | cancel_slot = {} |
||
| ) |
Write a frame to the connection.
Serializes the frame and writes it to the socket.
| frame | The frame to write |
| cancel_slot | Optional cancellation slot for graceful shutdown |