예제 #1
0
파일: World.cpp 프로젝트: Eitani/SwTor-1.3
		//---------------------------------------------------------------------
		void World::OnConnection(Network::Connection::pointer pConnection)
		{
			Session::pointer session = boost::make_shared<Session>(pConnection, this, ++mId);

			mGuard.lock();
			mSessions.push_back(session);
			mGuard.unlock();

			session->Start();
		}
예제 #2
0
파일: server.hpp 프로젝트: hamazy/shiritori
    void handle_accept(session::pointer session, boost::system::error_code const &error)
    {
        if (error) return;

        session->start();
        start_accept();
    }
예제 #3
0
파일: server.cpp 프로젝트: pfussell/pivotal
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);
	}
}
예제 #4
0
파일: server.cpp 프로젝트: samcoe/capstone
void server::accept(session::pointer new_session,
        const boost::system::error_code& error)
{
    if (!error)
    {
        new_session->start();
        listen();
    }
}