예제 #1
0
void run_test(connections_t& v
	, bandwidth_manager& manager
	, boost::function<void()> f = &nop)
{
	std::cerr << "-------------" << std::endl;
	
	std::for_each(v.begin(), v.end()
		, boost::bind(&peer_connection::start, _1));

	for (int i = 0; i < int(sample_time * 10); ++i)
	{
		manager.update_quotas(milliseconds(100));
		if ((i % 15) == 0) f();
	}
}
void run_test(connections_t& v
	, bandwidth_manager& manager
	, boost::function<void()> f = &nop)
{
	std::cerr << "-------------" << std::endl;
	
	std::for_each(v.begin(), v.end()
		, boost::bind(&peer_connection::start, _1));

	libtorrent::aux::session_settings s;
	initialize_default_settings(s);
	int tick_interval = s.get_int(settings_pack::tick_interval);

	for (int i = 0; i < int(sample_time * 1000 / tick_interval); ++i)
	{
		manager.update_quotas(milliseconds(tick_interval));
		if ((i % 15) == 0) f();
	}
}