Michael Mckeown
2016-05-09 14:45:01 UTC
dht.dht_nodes always returns 0.
I believe I have things set up correctly as a trackerless torrent will
happily download:
std::vector<stats_metric> map = session_stats_metrics ( );
for ( std::vector<stats_metric>::const_iterator i = map.begin ( );
i != map.end ( ); ++i )
{
if ( i->name == "dht.dht_nodes" )
{
statistics.dht_nodes = i->value_index;
}
}
------
Client_Session->post_session_stats ( );
std::vector<libtorrent::alert*> alerts;
Client_Session->pop_alerts ( &alerts );
for ( libtorrent::alert const* a : alerts )
{
if ( auto se = libtorrent::alert_cast<
libtorrent::session_stats_alert >( a ) )
{
std::string nodes = std::to_string ( se->values [
statistics.dht_nodes ] );
std::cout << "DHT Nodes: " << nodes << "\n";
}
}
that's how I'm doing things,
peer.num_peers_connected/net.sent_payload_bytes/net.recv_payload_bytes/net.has_incoming_connections
work as expected via the above method.
Any pointers on how to fix this?
Thanks.
I believe I have things set up correctly as a trackerless torrent will
happily download:
std::vector<stats_metric> map = session_stats_metrics ( );
for ( std::vector<stats_metric>::const_iterator i = map.begin ( );
i != map.end ( ); ++i )
{
if ( i->name == "dht.dht_nodes" )
{
statistics.dht_nodes = i->value_index;
}
}
------
Client_Session->post_session_stats ( );
std::vector<libtorrent::alert*> alerts;
Client_Session->pop_alerts ( &alerts );
for ( libtorrent::alert const* a : alerts )
{
if ( auto se = libtorrent::alert_cast<
libtorrent::session_stats_alert >( a ) )
{
std::string nodes = std::to_string ( se->values [
statistics.dht_nodes ] );
std::cout << "DHT Nodes: " << nodes << "\n";
}
}
that's how I'm doing things,
peer.num_peers_connected/net.sent_payload_bytes/net.recv_payload_bytes/net.has_incoming_connections
work as expected via the above method.
Any pointers on how to fix this?
Thanks.