-3

我需要使用 Sockets 在 java 上使用 web 服务来同步我构建的服务器。你能给我任何建议吗?我打算使用对称时间模型,但即使我知道它的逻辑,我也无法实现它。

谢谢

4

1 回答 1

1

Suggestions:

  • The best idea (IMO) is to deploy (or configure) NTP on the servers and synchronize them all to a reliable network time source. See the answers to your previous question!

  • If you do have to implement your own time synchronization, you'll need to figure out how to implement some time model. Asking someone else how to do it is not going to help, because it is not something that people do. (Why would they bother? NTP does the job ...)

  • The simpler alternative is to set up a simple server on one of the machines (designated the "time master" or "time lord" or something), that tells a client what its time clock says. Then the clients just get the time from the client, and set their clock to it. (The snag is that things can go wrong if the "time lord" machine's clock drifts or if gets set to a bogus value somehow.)

于 2012-06-03T00:03:28.810 回答