rlpx::RlpxSession¶
RLPx session managing encrypted P2P communication.
#include <rlpx_session.hpp>
Inherits from std::enable_shared_from_this< RlpxSession >
Public Classes¶
| Name | |
|---|---|
| class | MessageChannel |
Public Functions¶
| Name | |
|---|---|
| Result< std::shared_ptr< RlpxSession > > | connect(const SessionConnectParams & params, boost::asio::yield_context yield) Factory for outbound connections. |
| Result< std::shared_ptr< RlpxSession > > | accept(const SessionAcceptParams & params, boost::asio::yield_context yield) Factory for inbound connections. |
| ~RlpxSession() | |
| RlpxSession(const RlpxSession & ) =delete | |
| RlpxSession & | operator=(const RlpxSession & ) =delete |
| RlpxSession(RlpxSession && other) | |
| RlpxSession & | operator=(RlpxSession && other) |
| VoidResult | post_message(framing::Message message) Send message (takes ownership via move). |
| Result< framing::Message > | receive_message(boost::asio::yield_context yield) Receive message (stackful coroutine pull model). |
| VoidResult | disconnect(DisconnectReason reason) Graceful disconnect (sync, callable from callbacks). |
| VoidResult | disconnect(DisconnectReason reason, boost::asio::yield_context yield) Graceful disconnect (coroutine overload). |
| void | set_hello_handler(HelloHandler handler) |
| void | set_disconnect_handler(DisconnectHandler handler) |
| void | set_ping_handler(PingHandler handler) |
| void | set_pong_handler(PongHandler handler) |
| void | set_generic_handler(MessageHandler handler) |
| SessionState | state() const |
| bool | is_active() const |
| const PeerInfo & | peer_info() const |
| uint8_t | negotiated_eth_version() const Return the negotiated ETH subprotocol version from HELLO capability matching. |
| const auth::FrameSecrets & | cipher_secrets() const |
Public Functions Documentation¶
function connect¶
static Result< std::shared_ptr< RlpxSession > > connect(
const SessionConnectParams & params,
boost::asio::yield_context yield
)
Factory for outbound connections.
Parameters:
- params Session connection parameters.
- yield Boost.Asio stackful coroutine context.
Return: Constructed session on success, SessionError on failure.
function accept¶
static Result< std::shared_ptr< RlpxSession > > accept(
const SessionAcceptParams & params,
boost::asio::yield_context yield
)
Factory for inbound connections.
Parameters:
- params Session accept parameters.
- yield Boost.Asio stackful coroutine context.
Return: Constructed session on success, SessionError on failure.
function ~RlpxSession¶
function RlpxSession¶
function operator=¶
function RlpxSession¶
function operator=¶
function post_message¶
Send message (takes ownership via move).
function receive_message¶
Receive message (stackful coroutine pull model).
Parameters:
- yield Boost.Asio stackful coroutine context.
Return: Next message on success, SessionError on failure.
function disconnect¶
Graceful disconnect (sync, callable from callbacks).
Parameters:
- reason Disconnect reason code.
function disconnect¶
Graceful disconnect (coroutine overload).
Parameters:
- reason Disconnect reason code.
- yield Boost.Asio stackful coroutine context.
function set_hello_handler¶
function set_disconnect_handler¶
function set_ping_handler¶
function set_pong_handler¶
function set_generic_handler¶
function state¶
function is_active¶
function peer_info¶
function negotiated_eth_version¶
Return the negotiated ETH subprotocol version from HELLO capability matching.
Return: 66, 67, 68, or 69 when a common ETH capability was negotiated; 0 otherwise.
function cipher_secrets¶
Updated on 2026-04-13 at 23:22:46 -0700