Esempio n. 1
0
	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_);
	}
Esempio n. 2
0
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);
}