summaryrefslogtreecommitdiff
path: root/src/server.hpp
blob: 5d12c973756a977e3b0996ca4fed3341257ae78b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include "FileDescriptor.hpp"
#include <memory>
#include <netinet/in.h>

class CServer {
  public:
	CServer(uint16_t port);
	~CServer();
	const CFileDescriptor *getSocket() const;

  private:
	CFileDescriptor m_sockfd;
	sockaddr_in		m_addr;

	mutable std::mutex m_mutex;
};
inline std::unique_ptr<CServer> g_pServer;