本文整理汇总了C++中session_ptr::start方法的典型用法代码示例。如果您正苦于以下问题:C++ session_ptr::start方法的具体用法?C++ session_ptr::start怎么用?C++ session_ptr::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类session_ptr
的用法示例。
在下文中一共展示了session_ptr::start方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_accept
void Connection::handle_accept(session_ptr session, const boost::system::error_code& error)
{
if (!error)
{
session->start();
session_ptr new_session(new Session(io_service_, room_));
acceptor_.async_accept(new_session->socket(), boost::bind(&Connection::handle_accept, this, new_session, boost::asio::placeholders::error));
}
}
示例2: handle_accept
void handle_accept(session_ptr new_session,
const asio::error_code& error)
{
if (!error)
{
new_session->start();
new_session.reset(new session(io_service_));
acceptor_.async_accept(new_session->socket(),
boost::bind(&server::handle_accept, this, new_session,
asio::placeholders::error));
}
}
示例3: handle_accept
void handle_accept(session_ptr new_session,
const boost::system::error_code& error)
{
if (!error)
{
new_session->start();
new_session.reset(new session(io_service_work_pool_.get_io_service(), io_service_pool_.get_io_service()));
acceptor_.async_accept(new_session->socket(),
boost::bind(&server::handle_accept, this, new_session,
boost::asio::placeholders::error));
}
}
示例4: handle_accept
void handle_accept(session_ptr new_session,
const boost::system::error_code& error)
{
if(!error)
{
cout << "accept connection ..." << endl;
new_session->start();
do_accept();
}
else
{
delete new_session;
}
}
示例5: handle_accept
void handle_accept(session_ptr new_session,
const boost::system::error_code & error)
{
if (!error)
{
std::cout << "New connection accepted" << std::endl;
new_session->start();
start_accept();
}
else if (error != boost::asio::error::operation_aborted)
{
// 'operation_aborted' error occurs on server stoppage
handle_error(error);
}
}
示例6: handle_accept
void server::handle_accept(session_ptr new_session,
const boost::system::error_code& error)
{
if (!error)
{
{
boost::mutex::scoped_lock lock(sessionsLock_);
sessions_.push_back(new_session);
session_ptr new_session(new session(io_service_, this, maxLength_));
acceptor_.async_accept(new_session->socket(),
boost::bind(&server::handle_accept, this, new_session,
boost::asio::placeholders::error));
}
new_session->start();
}
start_accept();
}