.. _program_listing_file_BackendAsyncmsg_Server.hpp: Program Listing for File Server.hpp =================================== |exhale_lsh| :ref:`Return to documentation for file ` (``BackendAsyncmsg/Server.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef NETIO3BACKEND_BACKENDASYNCMSG_SERVER_HPP #define NETIO3BACKEND_BACKENDASYNCMSG_SERVER_HPP #include #include #include #include #include #include "Types.hpp" namespace netio3::asyncmsg { class Server : public felix::asyncmsg::Server { public: explicit Server(boost::asio::io_service& ioService, NetworkConfig config, std::function onShutdownCb, std::function addEventCb, BaseEventLoop* eventloop, bool useAsioEventLoop, Mode mode); void startAccept(); void onAccept(std::shared_ptr session) override; void onAcceptError(const boost::system::error_code& error, std::shared_ptr session) override; void shutdown(); private: void closeSession(std::shared_ptr session); std::reference_wrapper m_ioService; NetworkConfig m_config{}; std::function m_onShutdownCb{}; std::function m_addEventCb{}; BaseEventLoop* m_eventloop{nullptr}; std::set> m_sessions{}; bool m_useAsioEventLoop{}; Mode m_mode{}; bool m_shuttingDown{false}; mutable std::mutex m_mutex{}; }; } // namespace netio3::asyncmsg #endif // NETIO3BACKEND_BACKENDASYNCMSG_SERVER_HPP