Buran Motion Planning Framework
|
3 #include <sys/socket.h>
4 #include <netinet/in.h>
6 #include "base/path_finder.h"
7 #include "continuous_path_finder.h"
8 #include <netinet/in.h>
10 #include <sys/socket.h>
14 #include "base/path_finder.h"
15 #include "continuous_path_finder.h"
16 #include <json/value.h>
17 #include <json/reader.h>
18 #include <semaphore.h>
45 virtual void init(
int port,
int maxClients,
int delay);
53 virtual void processCommand(
int clientSocket,
int command, Json::Value jsonData) = 0;
70 void stop() { _terminated =
true; }
77 return accept(_serverFD, (
struct sockaddr *) &_address, (socklen_t *) &_addrLen);
90 const sockaddr_in &
getAddress()
const {
return _address; }
103 struct sockaddr_in _address;
127 std::string _commandBuf;
Базовый класс для всех серверов Для реализации сервера, необходимо переопределить две чисто виртуальн...
Definition: base_server.h:26
int getServerFd() const
Definition: base_server.h:84
void processRequests(int clientSocket)
Definition: base_server.cpp:77
static void initLinuxServerSocket()
Definition: base_server.cpp:6
virtual void onSocketConnected(int clientSocket)=0
void mainLoop()
Definition: base_server.cpp:17
const sockaddr_in & getAddress() const
Definition: base_server.h:90
void stop()
Definition: base_server.h:70
virtual void init(int port, int maxClients, int delay)
Definition: base_server.cpp:37
sem_t _sem
Definition: base_server.h:96
int acceptNewSocket()
Definition: base_server.h:76
virtual void processCommand(int clientSocket, int command, Json::Value jsonData)=0