29 lines
489 B
C++
29 lines
489 B
C++
|
|
#ifndef SOCKHAND_HPP
|
|
#define SOCKHAND_HPP
|
|
|
|
#include <expected>
|
|
#include <semaphore>
|
|
#include <string>
|
|
#include <mutex>
|
|
|
|
#include <interface.hpp>
|
|
|
|
|
|
|
|
|
|
class SocketHandler {
|
|
private:
|
|
int sock;
|
|
std::mutex intMtx;
|
|
std::binary_semaphore done{0};
|
|
Interface interface;
|
|
public:
|
|
void Handle(int newsock, std::string laddr, std::string raddr, int prefix);
|
|
void RecvMessages(void);
|
|
void SendMessages(std::string raddr, int prefix);
|
|
};
|
|
|
|
#endif
|
|
|