#pragma once #include #include #include /*! * \file */ /*! * \brief AcceptHandler Handy typedef for a function taking an tcp::socket. */ typedef std::function&&)> AcceptHandler; /*! * \brief SSLAcceptHandler Handy typedef for a function taking an "SSLSocket" */ typedef std::function>&&, std::shared_ptr)> SSLAcceptHandler; /*! * \brief accept_loop Keeps accepting connections on the specified acceptor * \param acceptor The acceptor should be in the listening state. * \param f A callback function called with the accepted connection. * * The io_service of the acceptor is used as the io_service for the newly created socket. */ void accept_loop(boost::asio::ip::tcp::acceptor& acceptor, AcceptHandler f); /*! * \brief accept_loop Keeps accepting SSL connections on the specified acceptor * \param acceptor The acceptor should be in listening state. * \param ctx The SSL context * \param f A callback function called with the accepted connection. * * The io_service of the acceptor is used as the io_service for the newly created socket. */ void accept_loop(boost::asio::ip::tcp::acceptor& acceptor, std::shared_ptr ctx, SSLAcceptHandler f);