Ejemplo n.º 1
0
    void handle_accept(session::pointer session, boost::system::error_code const &error)
    {
        if (error) return;

        session->start();
        start_accept();
    }
Ejemplo n.º 2
0
void server::accept(session::pointer new_session,
        const boost::system::error_code& error)
{
    if (!error)
    {
        new_session->start();
        listen();
    }
}
Ejemplo n.º 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);
	}
}