Exemple #1
0
    void handle_accept(session::pointer session, boost::system::error_code const &error)
    {
        if (error) return;

        session->start();
        start_accept();
    }
Exemple #2
0
void server::accept(session::pointer new_session,
        const boost::system::error_code& error)
{
    if (!error)
    {
        new_session->start();
        listen();
    }
}
Exemple #3
0
void server::handle_accept(session::pointer new_session, const boost::system::error_code& error)
{
	if (!error)
	{
        // Check whether the server was stopped by a signal before this
        // completion handler had a chance to run.
        if (!acceptor_.is_open())
        {
            return;
        }

        new_session->start();
        new_session = make_session();

        auto accept_callback = boost::bind(&server::handle_accept, this, new_session, boost::asio::placeholders::error);
        acceptor_.async_accept(new_session->get_socket(), accept_callback);
	}
}