File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Synchronizing the clocks Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Synchronizing the clocks" Watch "Synchronizing the clocks" New topic
Author

Synchronizing the clocks

Salima
Greenhorn

Joined: Apr 28, 2002
Posts: 3
Hi,
I want to know that while running client-server applications, how one should synchronize the clock. I mean system clock can't be synchorinize, since server may be in other continent. Please help me ASAP.
Thanks in advance
Salima
Thomas Smets
Ranch Hand

Joined: Dec 11, 2001
Posts: 111
By regularly exchanging time the two could be kept more or less in synch.
My advise is to generally speaking have one server as the reference server...
The stupid question is :

Why do you wanna do that at application level while the system could be as well synchronize (system call Time) ?
Rgds,
Thomas,


Thomas Smets
Just another developper
Salima
Greenhorn

Joined: Apr 28, 2002
Posts: 3
Hi,
I am writing a client server application to send an audio file to server and Server will send that file to Client2. I need to calculate the time when the packet start from client1 and reaches server. Since my Clients and Server will run on different m/c's so i won't be having the synchronized clock. System clock on different m/c could show different time. My question is how to synchronize the time in this application.
Thanks in advance
Salima
Thomas Smets
Ranch Hand

Joined: Dec 11, 2001
Posts: 111
If you are writting the C & the S why don't you calculate the double time :
i.e., C --> S --> C.
You could then "ping" one from the other ?
When I write ping, it may be your own echo-server !
Rgds,
Thomas SMETS,
SCJP 2 - Brussels
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Synchronizing the clocks
 
Similar Threads
Bea weblogic 10.3g setting up clock skew
multiple domains with apache
WA #1.....word association
maintaining proper UTC date/time in javascript
Clock