diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h')
| -rw-r--r-- | Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h | 48 |
1 files changed, 48 insertions, 0 deletions
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 <boost/asio.hpp>
+#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_*/
|
