This repository has been archived on 2025-03-15. You can view files and clone it, but cannot push or open issues or pull requests.
sparkle/libs/network/network.hpp
fluttershy 5a34d87814 fixes
2025-01-30 23:05:59 +05:00

23 lines
857 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;
auto operator=(const NetworkManager&) -> NetworkManager& = delete;
auto operator=(NetworkManager&&) -> NetworkManager& = delete;
NetworkManager(NetworkManager&&) = delete;
NetworkManager(const NetworkManager&) = delete;
NetworkManager();
~NetworkManager();
static auto WriteCallback(void* contents, unsigned long size, unsigned long nmemb, void* userp) -> unsigned long;
public:
static auto getInstance() -> NetworkManager&;
[[nodiscard]] auto getLatency() const -> unsigned long;
auto request(const std::string& method, const std::string& path, const std::string& data = "") -> std::string;
};
#endif