27 lines
619 B
C++
27 lines
619 B
C++
#ifndef SERVER_HPP
|
|
#define SERVER_HPP
|
|
|
|
#include "maze.hpp"
|
|
|
|
#include <iostream>
|
|
#include <thread>
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <netdb.h>
|
|
#include <unistd.h>
|
|
#include <cstring>
|
|
|
|
const int MAX_CLIENTS = 512;
|
|
|
|
class Server {
|
|
private:
|
|
bool service_mode;
|
|
int server_fd;
|
|
void handle_client(int client_socket, bool _mode); // Принимает клиентский сокет
|
|
bool check_status(Maze& maze);
|
|
public:
|
|
Server(const std::string& h = "localhost", const unsigned short p = 1024u, bool service_mode = false);
|
|
void start(); // Запуск сервера
|
|
};
|
|
|
|
#endif |