dlsantos / dnp3

Automatically exported from code.google.com/p/dnp3
0 stars 0 forks source link

Changing Slave date asynchronously causes time sync to not behave properly #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. Setup Slave to time sync at rate of 60 seconds
2. Wait until time sync occurs
3. Change the system date back 60 seconds
4. Wait until time sync occurs
5. Calculate the amount of time between steps (2) and (4)

The delay between steps (2) and (4) with step (3) injected is 120 seconds, not 
the expected 60 seconds.  This is due to the expires_from_now() absolute time 
reference used in TimerSourceASIO.cpp.  
https://github.com/gec/dnp3/blob/master/APL/TimerSourceASIO.cpp#L46

The expected behavior is that the sleep operation is relative, not absolute.  
So the time sync will always occur within 60 seconds, regardless of any jitter 
in or changes to the system clock that happen to occur within the 60 second 
window.

Original issue reported on code.google.com by chris.ve...@gmail.com on 29 Nov 2011 at 12:10