本文整理汇总了C++中udp::endpoint::protocol方法的典型用法代码示例。如果您正苦于以下问题:C++ endpoint::protocol方法的具体用法?C++ endpoint::protocol怎么用?C++ endpoint::protocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类udp::endpoint
的用法示例。
在下文中一共展示了endpoint::protocol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
impl(udp::endpoint endpoint,
Concurrency::ISource<core::monitor::message>& source)
: endpoint_(endpoint)
, socket_(service_, endpoint_.protocol())
, thread_(std::bind(&boost::asio::io_service::run, &service_))
, on_next_([this](const core::monitor::message& msg){ on_next(msg); })
{
source.link_target(&on_next_);
}
示例2: direct_request
void dht_tracker::direct_request(udp::endpoint const& ep, entry& e
, std::function<void(msg const&)> f)
{
#if TORRENT_USE_IPV6
if (ep.protocol() == udp::v6())
m_dht6.direct_request(ep, e, f);
else
#endif
m_dht.direct_request(ep, e, f);
}