A connection to the Stocks WebSocket streams, returned connected by WebsocketStreams::connect().
More...
#include <websocket_streams.hpp>
|
| const common::WebsocketStreamsConfig & | configuration () const noexcept |
| void | disconnect () |
| template<class CompletionToken> |
| auto | async_disconnect (CompletionToken &&token) |
| bool | is_connected () const |
| void | ping_server () |
| | Sends a ping frame on every open connection.
|
| template<class F> |
| common::Subscription | on_event (F &&callback) |
| | Registers a lifecycle callback (common::WebsocketEvent).
|
| common::WebsocketStreamHandle | stream (std::string name, std::optional< common::StreamId > id={}, std::optional< std::string > url_path={}) |
| | Subscribes to a stream by its name, for streams the SDK does not wrap yet, and returns a handle for its callbacks (payloads as boost::json::value).
|
| void | subscribe (const std::vector< std::string > &streams, std::optional< common::StreamId > id={}, const std::optional< std::string > &url_path={}) |
| | Subscribes to raw stream names. Messages are delivered to handles from stream().
|
| void | unsubscribe (const std::vector< std::string > &streams, std::optional< common::StreamId > id={}, const std::optional< std::string > &url_path={}) |
| bool | is_subscribed (const std::string &stream) const |
| template<class CompletionToken> |
| auto | async_wait_subscribed (std::string stream, std::optional< std::string > url_path, CompletionToken &&token) |
| | Completes once the server has acknowledged the subscription of stream; see common::WebsocketStreams::async_wait_subscribed.
|
| void | wait_subscribed (std::string stream, std::optional< std::string > url_path={}, std::optional< std::chrono::milliseconds > timeout={}) |
| common::WebsocketStream< CalendarStreamResponse > | calendar_stream (const CalendarStreamParams ¶ms={}) const |
| | Calendar Stream.
|
| common::WebsocketStream< KlineStreamResponse > | kline_stream (const KlineStreamParams ¶ms) const |
| | Kline Stream.
|
| common::WebsocketStream< PriceStreamResponse > | price_stream (const PriceStreamParams ¶ms={}) const |
| | Price Stream.
|
| common::WebsocketStream< QuoteStreamResponse > | quote_stream (const QuoteStreamParams ¶ms) const |
| | Quote Stream.
|
| common::WebsocketStream< TradabilityStreamResponse > | tradability_stream (const TradabilityStreamParams ¶ms) const |
| | Tradability Stream.
|
| common::WebsocketStream< TradingStatusStreamResponse > | trading_status_stream (const TradingStatusStreamParams ¶ms) const |
| | Trading Status Stream.
|
| common::WebsocketStream< OrderReportStreamResponse > | order_report_stream (const OrderReportStreamParams ¶ms) const |
| | Order Report Stream.
|
A connection to the Stocks WebSocket streams, returned connected by WebsocketStreams::connect().
Cheap to copy: copies share one common::WebsocketStreams (connection pool and executor), which reconnects, renews its connections and resubscribes until disconnect().
◆ configuration()
◆ disconnect()
| void binance::stocks::websocket_streams::WebsocketStreamsConnection::disconnect |
( |
| ) |
|
|
inline |
◆ async_disconnect()
template<class CompletionToken>
| auto binance::stocks::websocket_streams::WebsocketStreamsConnection::async_disconnect |
( |
CompletionToken && | token | ) |
|
|
inline |
◆ is_connected()
| bool binance::stocks::websocket_streams::WebsocketStreamsConnection::is_connected |
( |
| ) |
const |
|
inlinenodiscard |
◆ ping_server()
| void binance::stocks::websocket_streams::WebsocketStreamsConnection::ping_server |
( |
| ) |
|
|
inline |
Sends a ping frame on every open connection.
◆ on_event()
template<class F>
| common::Subscription binance::stocks::websocket_streams::WebsocketStreamsConnection::on_event |
( |
F && | callback | ) |
|
|
inline |
◆ stream()
Subscribes to a stream by its name, for streams the SDK does not wrap yet, and returns a handle for its callbacks (payloads as boost::json::value).
Data arriving before the first callback is added is kept for it (up to 1000 messages).
◆ subscribe()
| void binance::stocks::websocket_streams::WebsocketStreamsConnection::subscribe |
( |
const std::vector< std::string > & | streams, |
|
|
std::optional< common::StreamId > | id = {}, |
|
|
const std::optional< std::string > & | url_path = {} ) |
|
inline |
Subscribes to raw stream names. Messages are delivered to handles from stream().
◆ unsubscribe()
| void binance::stocks::websocket_streams::WebsocketStreamsConnection::unsubscribe |
( |
const std::vector< std::string > & | streams, |
|
|
std::optional< common::StreamId > | id = {}, |
|
|
const std::optional< std::string > & | url_path = {} ) |
|
inline |
◆ is_subscribed()
| bool binance::stocks::websocket_streams::WebsocketStreamsConnection::is_subscribed |
( |
const std::string & | stream | ) |
const |
|
inlinenodiscard |
◆ async_wait_subscribed()
template<class CompletionToken>
| auto binance::stocks::websocket_streams::WebsocketStreamsConnection::async_wait_subscribed |
( |
std::string | stream, |
|
|
std::optional< std::string > | url_path, |
|
|
CompletionToken && | token ) |
|
inline |
◆ wait_subscribed()
| void binance::stocks::websocket_streams::WebsocketStreamsConnection::wait_subscribed |
( |
std::string | stream, |
|
|
std::optional< std::string > | url_path = {}, |
|
|
std::optional< std::chrono::milliseconds > | timeout = {} ) |
|
inline |
◆ calendar_stream()
◆ kline_stream()
◆ price_stream()
◆ quote_stream()
◆ tradability_stream()
◆ trading_status_stream()
◆ order_report_stream()
◆ WebsocketStreams
| friend class WebsocketStreams |
|
friend |