I'm developing a client/server software, and I'm searching the best way to keep my client clocks in sync with the server clock.
Of course, I can't use NTP because I don't want to touch the system clock. I'm just trying to compute a timegap so that I can add it to every single datetime received from the server to convert it into a 'local time'
What I do for know is that :
I handle the TimeZone problems using GMT time
Server send its current time to Client upon connection, and Client subtract the server time from its time to compute the timegap.
This works great when network lag is constant (read "my LAN"...)
Unfortunately, I want my software to work on the Internet, and even on mobile clients, for which I've witnessed lag variations up to 1 minute.
For the software I'm working on, such a lag is not acceptable.
What would be a good strategy to compute the client/server timegap?
Last thing : I can send messages in both way (client to server AND server to client)
It's probably irrelevant, but the technology behind this is a .net WCF client using an httpbinding with some polling