2022-09-04 03:06:09 +02:00

37 lines
680 B
C++

#ifndef GERMANAIRLINESVA_GACONNECTOR_SOCKET_H
#define GERMANAIRLINESVA_GACONNECTOR_SOCKET_H
#define BUFSIZE 1024
#define MD5LEN 16
#include <json.hpp>
#include "types.h"
#include "util.hpp"
#include <cstring>
#include <functional>
#include <iostream>
#include <mutex>
#include <sstream>
#include <string>
#include <utility>
class Socket
{
private:
char lastPath[513] = "";
char lastHash[2 * MD5LEN + 1] = "";
std::mutex wsLock;
std::string url;
std::function<void(std::string)> toLog;
public:
explicit Socket(std::string url,
std::function<void(const std::string)> toLog);
~Socket();
void sendData(data d);
};
#endif