使用Java在服务器和Internet之间进行时间同步 [英] Time synchronization between server and Internet using Java

查看:29
本文介绍了使用Java在服务器和Internet之间进行时间同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是为 1 个服务器和 3 个客户端开发 Messenger.我面临时间同步问题:我必须将服务器时间与互联网同步,然后还要同步客户端.我怎样才能做到这一点?

I have an assignment for developing a messenger for 1 server and 3 clients. I am facing a problem with time synchronization: I have to synchronize the server time with the internet and then synchronize the clients also. How can I accomplish this?

推荐答案

使用 NTP同步不同的时钟.您需要一个 NTP 库,也许是这个.

Use NTP to synchronize the different clocks. You'll want an NTP library, perhaps this one.

这篇关于使用Java在服务器和Internet之间进行时间同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆