ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccrtp-devel] TimerPort::incTimer(RATE) doesn't increment RATE properly


From: j.s.bach
Subject: [Ccrtp-devel] TimerPort::incTimer(RATE) doesn't increment RATE properly
Date: Tue, 10 Jun 2008 18:26:28 +0200 (CEST)

Hello,

I'm going to ask my question here as i couldnt find any cc++ mailing list(?) 
for 
discussing the problem. As i was coding for a small application, i realized a 
strange behaviour
of TimerPort::incTimer(RATE)...

As it's already shown in the examples of ccrtp project, the code for a receiver:

for(int i = 0 ; true ; i++) {
    // getData from incoming queue, not relevant now.
    // ...

   cout << "[BEFORE SLEEP]:\t\t" << TimerPort::getTimer() << endl;
Thread::sleep(TimerPort::getTimer()) ;
    cout << "[BEFORE INCTIMER]:\t" << TimerPort::getTimer() << endl;
TimerPort::incTimer(RATE) ;
    cout << "[END INCTIMER]:\t\t" << TimerPort::getTimer() << endl;
}

The output is:

BEFORE SLEEP]:             9
[BEFORE INCTIMER]:      0
[END INCTIMER]:          20
[BEFORE SLEEP]:          19
[BEFORE INCTIMER]:      0
[END INCTIMER]:         21
[BEFORE SLEEP]:          20
[BEFORE INCTIMER]:      0
[END INCTIMER]:           0   // according to my /usr/include/cc++/thread.h 
incTimer increments 
                                         // the (RATE) to the value what is 
left from the last setTimer()
                                        // so it must be again 20 milisecs 
(0+20 = 20 )

So my question is why does incTimer member function of TimerPort stop adding 
the (RATE) to value
after sometime? Has anyone had the same problem?

Thanx in advance (!!)









reply via email to

[Prev in Thread] Current Thread [Next in Thread]