blob: 5ac8393bb0bcda2bf8fa331c92489eae4fd09a6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#pragma once
#include <vector>
#include <memory>
#include <mutex>
#include <thread>
#include "client.hpp"
//since this will be running on our vps we dont need string encryption or protection for anything
//which is cool, i guess
namespace server
{
class c_server {
// not sure if even needed.
std::mutex m_mutex;
private:
WSADATA m_sock_data{ };
SOCKET m_socket{ };
public:
~c_server( ) {
if ( m_socket )
closesocket( m_socket );
}
int init( );
void listen( );
void client_loop( );
};
}
extern server::c_server g_server;
|