本文整理汇总了C++中channel::ptr::start方法的典型用法代码示例。如果您正苦于以下问题:C++ ptr::start方法的具体用法?C++ ptr::start怎么用?C++ ptr::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类channel::ptr
的用法示例。
在下文中一共展示了ptr::start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start_channel
// protected:
void session::start_channel(channel::ptr channel,
result_handler handle_started)
{
channel->set_notify(notify_on_connect_);
channel->set_nonce(pseudo_random(1, max_uint64));
// The channel starts, invokes the handler, then starts the read cycle.
channel->start(
BIND_3(handle_starting, _1, channel, handle_started));
}
示例2: handle_pend
void session::handle_pend(const code& ec, channel::ptr channel,
result_handler handle_started)
{
if (ec)
{
handle_started(ec);
return;
}
// The channel starts, invokes the handler, then starts the read cycle.
channel->start(
BIND_3(handle_channel_start, _1, channel, handle_started));
}
示例3: start_talking
void protocol::start_talking(channel::ptr node,
proxy::stop_handler handle_stop, bool relay)
{
node->subscribe_stop(handle_stop);
// Notify protocol subscribers of new channel.
channel_subscriber_->relay(error::success, node);
const auto callback =
dispatch_.ordered_delegate(&protocol::handle_handshake,
this, _1, node);
// TODO: set height.
const uint32_t blockchain_height = 0;
// Attach version protocol to the new connection (until complete).
std::make_shared<protocol_version>(node, pool_, timeouts_.handshake,
callback, hosts_, self_, blockchain_height, relay)->start();
// Start reading from the socket (causing subscription events).
node->start();
}