Choose hostname and port (for server and client part)
This commit is contained in:
@@ -6,16 +6,15 @@
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
|
||||
const int PORT = 8080;
|
||||
|
||||
#include <netdb.h>
|
||||
class Client{
|
||||
private:
|
||||
int sock;
|
||||
public:
|
||||
Client() : sock(0){};
|
||||
void run();
|
||||
Client();
|
||||
void run(const std::string& h = "localhost", const unsigned short p = 1024u);
|
||||
int ping(struct sockaddr_in);
|
||||
void game();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -7,11 +7,11 @@
|
||||
#include <thread>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
#include <cstring>
|
||||
|
||||
const int PORT = 8080;
|
||||
const int MAX_CLIENTS = 100;
|
||||
const int MAX_CLIENTS = 512;
|
||||
|
||||
class Server {
|
||||
private:
|
||||
@@ -20,7 +20,7 @@ private:
|
||||
bool check_status(Maze& maze);
|
||||
public:
|
||||
Server() : service_mode(false){};
|
||||
void start(); // Запуск сервера
|
||||
void start(const std::string& h = "localhost", const unsigned short p = 1024u); // Запуск сервера
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user