9 #ifndef CLUON_TCPSERVER_HPP 10 #define CLUON_TCPSERVER_HPP 20 #include <netinet/in.h> 47 TCPServer(uint16_t port, std::function<
void(std::string &&from, std::shared_ptr<cluon::TCPConnection> connection)> newConnectionDelegate) noexcept;
54 bool isRunning()
const noexcept;
62 void closeSocket(
int errorCode) noexcept;
63 void readFromSocket() noexcept;
66 mutable std::mutex m_socketMutex{};
69 std::atomic<bool> m_readFromSocketThreadRunning{
false};
70 std::thread m_readFromSocketThread{};
72 std::mutex m_newConnectionDelegateMutex{};
73 std::function<void(std::string &&from, std::shared_ptr<cluon::TCPConnection> connection)> m_newConnectionDelegate{};
Definition: TCPServer.hpp:33
#define LIBCLUON_API
Definition: cluon.hpp:56