Re: [reSIProcate] Suggestion to replace GetSystemTime() with GetT ickCount() on Windows
This problem happens with many SIP systems. Remember we also have to put a
Date header in and it needs to be the real time. Some system solve this by
saying that changing the time by more than several seconds is one of the
things you need to stop the service to do and recommend that devices run
NTP.
It might be possible to make the timers relative and the GetSystemTime still
absolute. Note that long relative times are be definition not that accurate.
If people want to extend the system to have both relative and absolute time,
it would be sort of nice but it is going to be a lot of work to get right
and nearly impossible to test that we got it right for all cases. It's
pretty low on my priority list given it is used for a weird corner case.
On 11/26/04 7:18 AM, "kaiduan xie" <kaiduanx@xxxxxxxx> wrote:
> Scott,
>
> Change in the method name is preferred. I will check
> how ACE do that for UNIX/Linux. I learned this from
> ACE.
>
> kaiduan
> --- Scott Godin <slgodin@xxxxxxxxxxxx> wrote:
>> Thanks for pointing this out Kaiduan.
>>
>> Note: GetTickCount returns a 32bit unsigned int
>> representing the number of
>> MS since the system was started.
>>
>> I believe this solution will work - even when the
>> count wraps after 49.7
>> days. But there are some problems:
>> 1. the method names getSystemTime is no longer
>> accurate
>> 2. the method getTimeMicroSec - will no longer have
>> microsecond resolution
>>
>> I would like to get this issue solved - so maybe a
>> change in the method
>> names and some new methods are required. Does
>> anyone know if UNIX or other
>> OSs support a similar call? ie. one that is not
>> dependant on the System
>> clock?
>>
>> Note: This problem is also a concern for systems
>> running NTP clients as NTP
>> clients can adjust the system clock and skew resip
>> timers.
>>
>>
>> -----Original Message-----
>> From: kaiduan xie [mailto:kaiduanx@xxxxxxxx]
>> Sent: Thursday, November 25, 2004 6:01 PM
>> To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
>> Subject: [reSIProcate] Suggestion to replace
>> GetSystemTime() with
>> GetTickCount() on Windows
>>
>> Hi, all,
>>
>> Today while running my DUM based SIP client, a
>> friend
>> changed my system time to backward, i.e., change
>> from
>> Nov 25 to Nov 24. And the SIP client didnot re-fresh
>> the registration anymore. After reviewing the Timer
>> class, and I found it is using GetSystemTime() and
>> this is the reason. The re-registration timer will
>> expire one day later! It is better to use the system
>> startup time instead of the wall-clock time, so
>> please
>> change GetSystemTime to GetTickCount() for Windows.
>> I
>> tested with the GetTickCount and found that there is
>> no problem.
>>
>> Any comments are welcome.
>>
>> kaiduan
>>
>>
> ______________________________________________________________________
>>
>> Post your free ad now! http://personals.yahoo.ca
>> _______________________________________________
>> resiprocate-devel mailing list
>> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
>>
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>>
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel