From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../src/XorayaPluginExecutor/TcpServer.h | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h (limited to 'Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h') diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h new file mode 100644 index 0000000..d62a480 --- /dev/null +++ b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h @@ -0,0 +1,48 @@ +/*! + * \file TcpServer.h + * \author S. Eisenhauer + * \date 27.10.2011 + * \brief Header of CTcpServer + */ +#ifndef CTCPSERVER_H_ +#define CTCPSERVER_H_ + +#include +#include "TcpConnection.h" + +class CPluginExecutor; + +/// tcp server on target +class CTcpServer +{ +public: + /// constructor + /// \param[in] pxExecutor pointer to main application + /// \param[in] io_service reference to io_service + /// \param[in] port TCP port to listen on + CTcpServer(CPluginExecutor* pxExecutor,boost::asio::io_service& io_service, int32_t port); + + /// destructor + ~CTcpServer(void); + + /// handle accept on a connection + /// \param[in] pNewCon Pointer to new connection object + /// \param[in] error error code on the connection + void vAcceptHandler(CTcpConnection::tConnectionPtr pNewCon, const boost::system::error_code& error); + + /// stop the server + void vStop(); + + /// get the io_service + boost::asio::io_service& xGetIoService() + { + return m_xIoService; + } + void vUploadLogMessage(const tstLogMessage& stLogMsg); +private: + boost::asio::ip::tcp::acceptor m_xAcceptor; + CPluginExecutor* m_pxExecutor; + boost::asio::io_service& m_xIoService; + void vStartAccept(); +}; +#endif /*CTCPSERVER_H_*/ -- cgit v1.2.3