![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Deadlines, size limits and pacing for an HTTP client. More...
#include <algotradelib/src/network/http_client.hpp>
Public Attributes | |
| std::chrono::seconds | timeout_ {30} |
| The deadline for each of DNS lookup, connect, TLS handshake, write and read, in AsyncHttpClient; HttpClient's blocking operations are not bounded by it. | |
| std::size_t | body_limit_ {8 * 1024 * 1024} |
| The largest response body accepted, in bytes. | |
| std::size_t | queue_limit_ {1024} |
| How many requests the queue may hold, the one being sent included (AsyncHttpClient); one more fails with queue_full, unsent. | |
| std::optional< RateLimitBudget > | rate_limit_ |
| The rate-limit budget that paces this connection's requests, or empty (the default) for no pacing (AsyncHttpClient only). The caller sets it; the broker clients pass it through. | |
| std::chrono::milliseconds | unreplayed_idle_limit_ {1000} |
| How long a kept-alive connection may sit idle and still carry a request other than a GET (one second by default). | |
Deadlines, size limits and pacing for an HTTP client.
Definition at line 77 of file http_client.hpp.
| std::size_t algotradelib::network::HttpClientOptions::body_limit_ {8 * 1024 * 1024} |
The largest response body accepted, in bytes.
Definition at line 84 of file http_client.hpp.
| std::size_t algotradelib::network::HttpClientOptions::queue_limit_ {1024} |
How many requests the queue may hold, the one being sent included (AsyncHttpClient); one more fails with queue_full, unsent.
Definition at line 89 of file http_client.hpp.
| std::optional<RateLimitBudget> algotradelib::network::HttpClientOptions::rate_limit_ |
The rate-limit budget that paces this connection's requests, or empty (the default) for no pacing (AsyncHttpClient only). The caller sets it; the broker clients pass it through.
Definition at line 95 of file http_client.hpp.
Referenced by kis_credentials::paced_options(), and kiwoom_credentials::paced_options().
| std::chrono::seconds algotradelib::network::HttpClientOptions::timeout_ {30} |
The deadline for each of DNS lookup, connect, TLS handshake, write and read, in AsyncHttpClient; HttpClient's blocking operations are not bounded by it.
Definition at line 82 of file http_client.hpp.
| std::chrono::milliseconds algotradelib::network::HttpClientOptions::unreplayed_idle_limit_ {1000} |
How long a kept-alive connection may sit idle and still carry a request other than a GET (one second by default).
A server closes idle connections on its own schedule (KIS after five seconds), and a request written into a closed connection fails. A GET is then sent again, but any other request (which may be an order) is not, so its outcome would be unknown. Such a request after a longer idle period is therefore sent on a fresh connection, at the cost of a TLS handshake (once per request in AsyncHttpClient; see its description).
Definition at line 107 of file http_client.hpp.