23 lines
795 B
C++
23 lines
795 B
C++
#ifndef TLS_NETWORK_HPP_
|
|
#define TLS_NETWORK_HPP_
|
|
#include <includes.hpp>
|
|
#include <network/websocket.hpp>
|
|
#include <curl/curl.h>
|
|
class NetworkManager {
|
|
private:
|
|
CURL* curl;
|
|
CURLcode res;
|
|
WebSocket& web;
|
|
NetworkManager& operator=(const NetworkManager&) = delete;
|
|
NetworkManager& operator=(NetworkManager&&) = delete;
|
|
NetworkManager(NetworkManager&&) = delete;
|
|
NetworkManager(const NetworkManager&) = delete;
|
|
NetworkManager();
|
|
~NetworkManager();
|
|
static unsigned long WriteCallback(void* contents, unsigned long size, unsigned long nmemb, void* userp);
|
|
public:
|
|
static NetworkManager& getInstance();
|
|
unsigned long getLatency() const;
|
|
std::string request(const std::string& method, const std::string& path, const std::string& data = "");
|
|
};
|
|
#endif |