Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::common::WebsocketStreamsConfig Struct Reference

WebSocket market / user streams configuration. More...

#include <config.hpp>

Public Attributes

std::optional< std::string > url
 wss://… (or ws://…). Set by the product factory when empty.
std::chrono::milliseconds reconnect_delay {5000}
std::chrono::milliseconds connect_timeout {10000}
 Time allowed to open one connection.
WebsocketMode mode
bool compression = true
std::size_t max_message_size = 64ULL * 1024 * 1024
std::optional< ProxyConfig > proxy
bool proxy_from_env = false
 When proxy is unset, use the proxy from the environment.
TlsContextHook agent
WebsocketTransportHook transport
std::optional< TimeUnit > time_unit
TimestampProvider timestamp_provider
 Source of the timestamp of signed requests; empty: the host clock.
std::optional< std::string > api_key
std::optional< std::string > api_secret
std::optional< PrivateKey > private_key
std::optional< std::string > private_key_passphrase
boost::asio::any_io_executor executor
 Runs the client on this executor instead of a thread of its own, so that many clients can share one event loop.

Detailed Description

WebSocket market / user streams configuration.

Member Data Documentation

◆ url

std::optional<std::string> binance::common::WebsocketStreamsConfig::url

wss://… (or ws://…). Set by the product factory when empty.

◆ reconnect_delay

std::chrono::milliseconds binance::common::WebsocketStreamsConfig::reconnect_delay {5000}

◆ connect_timeout

std::chrono::milliseconds binance::common::WebsocketStreamsConfig::connect_timeout {10000}

Time allowed to open one connection.

When the host resolves to several addresses, they are tried with staggered attempts (the next address after 250 ms or as soon as the previous one fails, earlier attempts keep running, the first to connect wins) within this one time.

◆ mode

WebsocketMode binance::common::WebsocketStreamsConfig::mode

◆ compression

bool binance::common::WebsocketStreamsConfig::compression = true

◆ max_message_size

std::size_t binance::common::WebsocketStreamsConfig::max_message_size = 64ULL * 1024 * 1024

◆ proxy

std::optional<ProxyConfig> binance::common::WebsocketStreamsConfig::proxy

◆ proxy_from_env

bool binance::common::WebsocketStreamsConfig::proxy_from_env = false

When proxy is unset, use the proxy from the environment.

Off by default, as for the WebSocket API.

◆ agent

TlsContextHook binance::common::WebsocketStreamsConfig::agent

◆ transport

WebsocketTransportHook binance::common::WebsocketStreamsConfig::transport

◆ time_unit

std::optional<TimeUnit> binance::common::WebsocketStreamsConfig::time_unit

◆ timestamp_provider

TimestampProvider binance::common::WebsocketStreamsConfig::timestamp_provider

Source of the timestamp of signed requests; empty: the host clock.

See TimestampProvider.

◆ api_key

std::optional<std::string> binance::common::WebsocketStreamsConfig::api_key

◆ api_secret

std::optional<std::string> binance::common::WebsocketStreamsConfig::api_secret

◆ private_key

std::optional<PrivateKey> binance::common::WebsocketStreamsConfig::private_key

◆ private_key_passphrase

std::optional<std::string> binance::common::WebsocketStreamsConfig::private_key_passphrase

◆ executor

boost::asio::any_io_executor binance::common::WebsocketStreamsConfig::executor

Runs the client on this executor instead of a thread of its own, so that many clients can share one event loop.

Keep it running for as long as the client has work, and do not make blocking calls from its threads. Empty: the client starts a dedicated thread.