blob: 5d6bdcf1d82fd24e430b91a55685b1649793a279 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#pragma once
#include "FileDescriptor.hpp"
#include "log.hpp"
#include <memory>
#include <netinet/in.h>
#include <string>
class CServer {
public:
CServer(uint16_t port);
~CServer();
void log(const eLogLevel loglevel, const std::string &message) const;
bool isValid();
Hyprutils::OS::CFileDescriptor getSocket() const;
private:
Hyprutils::OS::CFileDescriptor m_sockfd;
sockaddr_in m_addr;
int m_dBind = -1;
int m_dListen = -1;
};
inline std::unique_ptr<CServer> g_pServer;
|