Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi Class Reference

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

#include <websocket_api.hpp>

Public Member Functions

 WebsocketApi (common::WebsocketApiConfig configuration)
const common::WebsocketApiConfig & configuration () const noexcept
WebsocketApiConnection connect (std::optional< common::WebsocketMode > mode={}) const
 Opens a connection (a pool of them with mode, overriding the configuration) and returns it once connected.
template<class CompletionToken>
auto async_connect (CompletionToken &&token) const
 Asynchronous connect(), completing with void(std::exception_ptr, WebsocketApiConnection).
template<class CompletionToken>
auto async_connect (std::optional< common::WebsocketMode > mode, CompletionToken &&token) const

Static Public Member Functions

static WebsocketApi from_config (common::WebsocketApiConfig config)
 A client for config.url, production when it is not set.
static WebsocketApi production (common::WebsocketApiConfig config)
 A client for production (Derivatives Trading Coin Futures WebSocket API).
static WebsocketApi testnet (common::WebsocketApiConfig config)
 A client for the testnet.

Detailed Description

DerivativesTradingCoinFutures WebSocket API 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

◆ WebsocketApi()

binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::WebsocketApi ( common::WebsocketApiConfig configuration)
explicit

Member Function Documentation

◆ from_config()

WebsocketApi binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::from_config ( common::WebsocketApiConfig config)
staticnodiscard

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

◆ production()

WebsocketApi binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::production ( common::WebsocketApiConfig config)
staticnodiscard

A client for production (Derivatives Trading Coin Futures WebSocket API).

◆ testnet()

WebsocketApi binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::testnet ( common::WebsocketApiConfig config)
staticnodiscard

A client for the testnet.

◆ configuration()

const common::WebsocketApiConfig & binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::configuration ( ) const
inlinenodiscardnoexcept

◆ connect()

WebsocketApiConnection binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::connect ( std::optional< common::WebsocketMode > mode = {}) const
inlinenodiscard

Opens a connection (a pool of them with mode, overriding the configuration) 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/2]

template<class CompletionToken>
auto binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::async_connect ( CompletionToken && token) const
inline

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

◆ async_connect() [2/2]

template<class CompletionToken>
auto binance::derivatives_trading_coin_futures::websocket_api::WebsocketApi::async_connect ( std::optional< common::WebsocketMode > mode,
CompletionToken && token ) const
inline