本文整理汇总了C++中channel::ptr::negotiated_version方法的典型用法代码示例。如果您正苦于以下问题:C++ ptr::negotiated_version方法的具体用法?C++ ptr::negotiated_version怎么用?C++ ptr::negotiated_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类channel::ptr
的用法示例。
在下文中一共展示了ptr::negotiated_version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attach_protocols
void session_manual::attach_protocols(channel::ptr channel)
{
if (channel->negotiated_version() >= message::version::level::bip31)
attach<protocol_ping_60001>(channel)->start();
else
attach<protocol_ping_31402>(channel)->start();
attach<protocol_address_31402>(channel)->start();
}
示例2: attach_handshake_protocols
// protected:
void session::attach_handshake_protocols(channel::ptr channel,
result_handler handle_started)
{
// The negotiated_version is initialized to the configured maximum.
if (channel->negotiated_version() >= message::version::level::bip61)
attach<protocol_version_70002>(channel)->start(handle_started);
else
attach<protocol_version_31402>(channel)->start(handle_started);
}
示例3: attach_protocols
void session_manual::attach_protocols(channel::ptr channel)
{
const auto version = channel->negotiated_version();
if (version >= version::level::bip31)
attach<protocol_ping_60001>(channel)->start();
else
attach<protocol_ping_31402>(channel)->start();
if (version >= message::version::level::bip61)
attach<protocol_reject_70002>(channel)->start();
attach<protocol_address_31402>(channel)->start();
attach<protocol_block_in>(channel, chain_)->start();
attach<protocol_block_out>(channel, chain_)->start();
attach<protocol_transaction_in>(channel, chain_)->start();
attach<protocol_transaction_out>(channel, chain_)->start();
}