blob: c42192b1b8307c81bd1d021d57d329359fdd980e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#pragma once
#include "../misc/FileDescriptor.hpp"
#include <memory>
#include <netinet/in.h>
class CServer {
public:
CServer(uint16_t port);
~CServer();
std::shared_ptr<CFileDescriptor> getSocket() const;
private:
std::shared_ptr<CFileDescriptor> m_sockfd;
sockaddr_in m_addr;
mutable std::mutex m_mutex;
};
inline std::unique_ptr<CServer> g_pServer;
|