algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::kiwoom::KiwoomAuth Class Reference

Obtains and caches a Kiwoom access token with blocking requests; thread-safe. More...

#include <algotradelib/src/brokers/kiwoom/auth.hpp>

Public Member Functions

 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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ KiwoomAuth()

algotradelib::kiwoom::KiwoomAuth::KiwoomAuth ( net::io_context & ioc,
ssl::context & ctx,
const KiwoomConfig & config )
inline

Constructs the wrapper.

Parameters
iocThe I/O context the requests run on; borrowed, and must outlive the wrapper.
ctxThe TLS context; borrowed, and must outlive the wrapper.
configThe credentials (copied).

Definition at line 29 of file auth.hpp.

Member Function Documentation

◆ 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_errorif the token request fails or its response cannot be read.
boost::system::system_erroron 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