Add complib client and TCP communication
This commit is contained in:
parent
1a033c8b03
commit
a484bc2137
35 changed files with 815 additions and 232 deletions
|
@ -1,6 +1,8 @@
|
|||
#ifndef COMPLIB_SERVER_MESSAGEBUILDER_HPP
|
||||
#define COMPLIB_SERVER_MESSAGEBUILDER_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
|
||||
#include "CompLib.pb.h"
|
||||
#include "include/Robot.hpp"
|
||||
|
|
20
server_v2/include/communication/TCPSocketServer.hpp
Normal file
20
server_v2/include/communication/TCPSocketServer.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef COMPLIB_SERVER_TCPSOCKETSERVER_HPP
|
||||
#define COMPLIB_SERVER_TCPSOCKETSERVER_HPP
|
||||
|
||||
#include <thread>
|
||||
|
||||
#define SOCKET_PATH "/tmp/compLib"
|
||||
#define SOCKET_BUFFER_SIZE 128
|
||||
|
||||
class TCPSocketServer {
|
||||
public:
|
||||
TCPSocketServer();
|
||||
|
||||
private:
|
||||
[[noreturn]] void server_loop();
|
||||
|
||||
std::thread server_thread;
|
||||
};
|
||||
|
||||
|
||||
#endif //COMPLIB_SERVER_TCPSOCKETSERVER_HPP
|
|
@ -4,7 +4,7 @@
|
|||
#include <thread>
|
||||
|
||||
#define SOCKET_PATH "/tmp/compLib"
|
||||
#define SOCKET_BUFFER_SIZE 64
|
||||
#define SOCKET_BUFFER_SIZE 128
|
||||
|
||||
class UnixSocketServer {
|
||||
public:
|
||||
|
|
Reference in a new issue