|
Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
|
WebSocket API (request / response) configuration. More...
#include <config.hpp>
Public Attributes | |
| std::optional< std::string > | api_key |
| std::optional< std::string > | api_secret |
| std::optional< std::string > | url |
| wss://… (or ws://…). Set by the product factory when empty. | |
| std::chrono::milliseconds | timeout {5000} |
| How long to wait for a response. | |
| std::chrono::milliseconds | reconnect_delay {5000} |
| Delay before reconnecting a connection that dropped. | |
| std::chrono::milliseconds | connect_timeout {10000} |
| Time allowed to open one connection: DNS, TCP, proxy, TLS and the WebSocket upgrade. | |
| WebsocketMode | mode |
| bool | compression = true |
| Negotiates permessage-deflate. | |
| std::size_t | max_message_size = 64ULL * 1024 * 1024 |
| Largest message accepted (after decompression). Larger messages close the connection. | |
| std::optional< ProxyConfig > | proxy |
| HTTP(S) proxy (reached with a CONNECT tunnel) or SOCKS5 proxy. | |
| bool | proxy_from_env = false |
| When proxy is unset, use the proxy from the environment (proxy_from_environment). | |
| TlsContextHook | agent |
| WebsocketTransportHook | transport |
| std::optional< PrivateKey > | private_key |
| std::optional< std::string > | private_key_passphrase |
| std::optional< TimeUnit > | time_unit |
| TimestampProvider | timestamp_provider |
| Source of the timestamp of signed requests; empty: the host clock. | |
| bool | auto_session_relogon = true |
| After a reconnect or renewal, logs the session on again if it was logged on through session.logon, and lets authenticated requests skip apiKey / signature meanwhile. | |
| 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. | |
WebSocket API (request / response) configuration.
| std::optional<std::string> binance::common::WebsocketApiConfig::api_key |
| std::optional<std::string> binance::common::WebsocketApiConfig::api_secret |
| std::optional<std::string> binance::common::WebsocketApiConfig::url |
wss://… (or ws://…). Set by the product factory when empty.
| std::chrono::milliseconds binance::common::WebsocketApiConfig::timeout {5000} |
How long to wait for a response.
| std::chrono::milliseconds binance::common::WebsocketApiConfig::reconnect_delay {5000} |
Delay before reconnecting a connection that dropped.
After a failed attempt, a backoff of 1 s doubling up to 60 s, with random jitter, is added to it.
| std::chrono::milliseconds binance::common::WebsocketApiConfig::connect_timeout {10000} |
Time allowed to open one connection: DNS, TCP, proxy, TLS and the WebSocket upgrade.
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, not a part of it per address.
| WebsocketMode binance::common::WebsocketApiConfig::mode |
| bool binance::common::WebsocketApiConfig::compression = true |
Negotiates permessage-deflate.
| std::size_t binance::common::WebsocketApiConfig::max_message_size = 64ULL * 1024 * 1024 |
Largest message accepted (after decompression). Larger messages close the connection.
| std::optional<ProxyConfig> binance::common::WebsocketApiConfig::proxy |
HTTP(S) proxy (reached with a CONNECT tunnel) or SOCKS5 proxy.
| bool binance::common::WebsocketApiConfig::proxy_from_env = false |
When proxy is unset, use the proxy from the environment (proxy_from_environment).
Off by default, as in the other Binance connectors, whose WebSocket connections ignore it.
| TlsContextHook binance::common::WebsocketApiConfig::agent |
| WebsocketTransportHook binance::common::WebsocketApiConfig::transport |
| std::optional<PrivateKey> binance::common::WebsocketApiConfig::private_key |
| std::optional<std::string> binance::common::WebsocketApiConfig::private_key_passphrase |
| std::optional<TimeUnit> binance::common::WebsocketApiConfig::time_unit |
| TimestampProvider binance::common::WebsocketApiConfig::timestamp_provider |
Source of the timestamp of signed requests; empty: the host clock.
See TimestampProvider.
| bool binance::common::WebsocketApiConfig::auto_session_relogon = true |
After a reconnect or renewal, logs the session on again if it was logged on through session.logon, and lets authenticated requests skip apiKey / signature meanwhile.
| boost::asio::any_io_executor binance::common::WebsocketApiConfig::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.