Obtains and caches a Kiwoom access token with blocking requests; thread-safe.
More...
#include <algotradelib/src/brokers/kiwoom/auth.hpp>
|
| | KiwoomAuth (net::io_context &ioc, ssl::context &ctx, const KiwoomConfig &config) |
| | Constructs the wrapper.
|
|
virtual | ~KiwoomAuth ()=default |
| | Destroys the wrapper.
|
| std::string | accessToken () |
| | Returns an access token, requesting a new one if none is held or it expires within five minutes.
|
Obtains and caches a Kiwoom access token with blocking requests; thread-safe.
KiwoomClient manages its own token; this is for code that calls Kiwoom directly.
Definition at line 21 of file auth.hpp.
◆ KiwoomAuth()
| algotradelib::kiwoom::KiwoomAuth::KiwoomAuth |
( |
net::io_context & | ioc, |
|
|
ssl::context & | ctx, |
|
|
const KiwoomConfig & | config ) |
|
inline |
Constructs the wrapper.
- Parameters
-
| ioc | The I/O context the requests run on; borrowed, and must outlive the wrapper. |
| ctx | The TLS context; borrowed, and must outlive the wrapper. |
| config | The credentials (copied). |
Definition at line 29 of file auth.hpp.
◆ accessToken()
| std::string algotradelib::kiwoom::KiwoomAuth::accessToken |
( |
| ) |
|
|
inline |
Returns an access token, requesting a new one if none is held or it expires within five minutes.
- Returns
- The token.
- Exceptions
-
| std::runtime_error | if the token request fails or its response cannot be read. |
| boost::system::system_error | on a transport failure. |
Definition at line 42 of file auth.hpp.
The documentation for this class was generated from the following file:
- algotradelib/src/brokers/kiwoom/auth.hpp