The binance depth stream must be bootstrapped with a depth snapshot, which is retrieved via an HTTP GET request
22 lines
438 B
C++
22 lines
438 B
C++
#include "CurlHandle.h"
|
|
#include <curl/curl.h>
|
|
#include <stdexcept>
|
|
|
|
namespace bts::http {
|
|
|
|
CurlHandle::CurlHandle() {
|
|
const auto eCode = curl_global_init(CURL_GLOBAL_ALL);
|
|
if (eCode != CURLE_OK) {
|
|
throw std::runtime_error{"Error initializing libCURL"};
|
|
}
|
|
}
|
|
|
|
CurlHandle::~CurlHandle() { curl_global_cleanup(); }
|
|
|
|
CurlHandle &CurlHandle::instance() {
|
|
static CurlHandle inst{};
|
|
return inst;
|
|
}
|
|
|
|
} // namespace bts::http
|