Ejemplo n.º 1
0
void connection_basic::set_rate_up_limit(uint64_t limit) {
	{
		CRITICAL_REGION_LOCAL(	network_throttle_manager::m_lock_get_global_throttle_out );
		network_throttle_manager::get_global_throttle_out().set_target_speed(limit);
	}
	save_limit_to_file(limit);
}
Ejemplo n.º 2
0
void connection_basic::set_rate_up_limit(uint64_t limit) {

    // TODO remove __SCALING_FACTOR...
    const double SCALING_FACTOR = 2.1; // to acheve the best performance
    limit *= SCALING_FACTOR;
    {
        CRITICAL_REGION_LOCAL(	network_throttle_manager::m_lock_get_global_throttle_out );
        network_throttle_manager::get_global_throttle_out().set_target_speed(limit);
        network_throttle_manager::get_global_throttle_out().set_real_target_speed(limit / SCALING_FACTOR);
    }
    save_limit_to_file(limit);
}