/*! * \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_*/