Skip to content

sgns::api::WsClientImpl

#include <ws_client_impl.hpp>

Inherits from std::enable_shared_from_this< WsClientImpl >

Public Types

Name
using boost::asio::io_context Context
using boost::asio::strand< boost::asio::io_context::executor_type > ExecutorType
using boost::asio::basic_stream_socket< boost::asio::ip::tcp > StreamSocket
using boost::beast::websocket::stream< StreamSocket > PlainWebSocketStream
using boost::beast::ssl_stream< StreamSocket > SSLStream
using boost::beast::websocket::stream< SSLStream > SecureWebSocketStream

Public Functions

Name
WsClientImpl(Context & context, const std::string & url)
void start()
void setMessageHandler(std::function< void(const std::string &)> handler)
void send(const std::string & message)
void stop()

Public Types Documentation

using Context

using sgns::api::WsClientImpl::Context = boost::asio::io_context;

using ExecutorType

using sgns::api::WsClientImpl::ExecutorType = boost::asio::strand<boost::asio::io_context::executor_type>;

using StreamSocket

using sgns::api::WsClientImpl::StreamSocket = boost::asio::basic_stream_socket<boost::asio::ip::tcp>;

using PlainWebSocketStream

using sgns::api::WsClientImpl::PlainWebSocketStream = boost::beast::websocket::stream<StreamSocket>;

using SSLStream

using sgns::api::WsClientImpl::SSLStream = boost::beast::ssl_stream<StreamSocket>;

using SecureWebSocketStream

using sgns::api::WsClientImpl::SecureWebSocketStream = boost::beast::websocket::stream<SSLStream>;

Public Functions Documentation

function WsClientImpl

WsClientImpl(
    Context & context,
    const std::string & url
)

function start

void start()

function setMessageHandler

void setMessageHandler(
    std::function< void(const std::string &)> handler
)

function send

void send(
    const std::string & message
)

function stop

void stop()

Updated on 2026-03-04 at 13:10:43 -0800