Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams Class Reference

DerivativesTradingPortfolioMargin WebSocket streams client: holds the configuration, and connect() opens a new connection with it, like the connect() of the other Binance connectors. More...

#include <websocket_streams.hpp>

Public Member Functions

 WebsocketStreams (common::WebsocketStreamsConfig configuration)
const common::WebsocketStreamsConfig & configuration () const noexcept
WebsocketStreamsConnection connect (std::vector< std::string > streams={}, std::optional< common::WebsocketMode > mode={}) const
 Opens a connection (a pool of them with mode, overriding the configuration), subscribed to streams (raw stream names), and returns it once connected.
template<class CompletionToken>
auto async_connect (CompletionToken &&token) const
 Asynchronous connect(), completing with void(std::exception_ptr, WebsocketStreamsConnection).
template<class CompletionToken>
auto async_connect (std::vector< std::string > streams, CompletionToken &&token) const
template<class CompletionToken>
auto async_connect (std::vector< std::string > streams, std::optional< common::WebsocketMode > mode, CompletionToken &&token) const

Static Public Member Functions

static WebsocketStreams from_config (common::WebsocketStreamsConfig config)
 A client for config.url, production when it is not set.
static WebsocketStreams production (common::WebsocketStreamsConfig config)
 A client for production (Derivatives Trading Portfolio Margin WebSocket streams).
static WebsocketStreams testnet (common::WebsocketStreamsConfig config)
 A client for the testnet.

Detailed Description

DerivativesTradingPortfolioMargin WebSocket streams client: holds the configuration, and connect() opens a new connection with it, like the connect() of the other Binance connectors.

Every call returns an independent connection.

Constructor & Destructor Documentation

◆ WebsocketStreams()

binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::WebsocketStreams ( common::WebsocketStreamsConfig configuration)
explicit

Member Function Documentation

◆ from_config()

WebsocketStreams binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::from_config ( common::WebsocketStreamsConfig config)
staticnodiscard

A client for config.url, production when it is not set.

◆ production()

WebsocketStreams binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::production ( common::WebsocketStreamsConfig config)
staticnodiscard

A client for production (Derivatives Trading Portfolio Margin WebSocket streams).

◆ testnet()

WebsocketStreams binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::testnet ( common::WebsocketStreamsConfig config)
staticnodiscard

A client for the testnet.

◆ configuration()

const common::WebsocketStreamsConfig & binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::configuration ( ) const
inlinenodiscardnoexcept

◆ connect()

WebsocketStreamsConnection binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::connect ( std::vector< std::string > streams = {},
std::optional< common::WebsocketMode > mode = {} ) const
inlinenodiscard

Opens a connection (a pool of them with mode, overriding the configuration), subscribed to streams (raw stream names), and returns it once connected.

Throws common::ConfigError if the configuration is invalid, and the error of the first connection that fails to open.

◆ async_connect() [1/3]

template<class CompletionToken>
auto binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::async_connect ( CompletionToken && token) const
inline

Asynchronous connect(), completing with void(std::exception_ptr, WebsocketStreamsConnection).

◆ async_connect() [2/3]

template<class CompletionToken>
auto binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::async_connect ( std::vector< std::string > streams,
CompletionToken && token ) const
inline

◆ async_connect() [3/3]

template<class CompletionToken>
auto binance::derivatives_trading_portfolio_margin::websocket_streams::WebsocketStreams::async_connect ( std::vector< std::string > streams,
std::optional< common::WebsocketMode > mode,
CompletionToken && token ) const
inline