ns-allinone-2.35/ns-2.35/apps/rtp.cc
void RTPAgent::rate_change()
{
	rtp_timer_.force_cancel();
	
	double t = lastpkttime_ + interval_;
	
	double now = Scheduler::instance().clock();
	if ( t > now)
		rtp_timer_.resched(t - now);
	else {
		sendpkt();
		rtp_timer_.resched(interval_);
	}
}
/* 
 * We modify the rate in this way to get a faster reaction to the a rate
 * change since a rate change from a very low rate to a very fast rate may 
 * take an undesireably long time if we have to wait for timeout at the old
 * rate before we can send at the new (faster) rate.
 */
We modify the rate in this way to get a faster reaction to the a rate
change since a rate change from a very low rate to a very fast rate may
take an undesireably long time if we have to wait for timeout at the old
rate before we can send at the new (faster) rate.
We modify the rate in this way to get a faster reaction to the a rate change since a rate change from a very low rate to a very fast rate may take an undesireably long time if we have to wait for timeout at the old rate before we can send at the new ( faster ) rate .
void RTPAgent::rate_change()
{
	rtp_timer_.force_cancel();
	double t = lastpkttime_ + interval_;
	double now = Scheduler::instance().clock();
	if ( t > now)
		rtp_timer_.resched(t - now);
	else {
		sendpkt();
		rtp_timer_.resched(interval_);
	}
}
void RTPAgent :: rate_change ( ) { rtp_timer_ . force_cancel ( ) ; double t = lastpkttime_ + interval_ ; double now = Scheduler :: instance ( ) . clock ( ) ; if ( t > now ) rtp_timer_ . resched ( t - now ) ; else { sendpkt ( ) ; rtp_timer_ . resched ( interval_ ) ; } }
We modify the rate in this way to get a faster reaction to the a rate
 change since a rate change from a very low rate to a very fast rate may
 take an undesireably long time if we have to wait for timeout at the old
 rate before we can send at the new (faster) rate.
We modify the rate in this way to get a faster reaction to the a rate change since a rate change from a very low rate to a very fast rate may take an undesireably long time if we have to wait for timeout at the old rate before we can send at the new ( faster ) rate .