爪哇,机器人,得到itnernet服务器原子时间 [英] Java, android, get atomic time from itnernet server

查看:185
本文介绍了爪哇,机器人,得到itnernet服务器原子时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想同步两个应用程序。
我怎样才能得到任何服务器的服务器时,精度可达1毫秒?或者只是10ms的?

i trying to synchronize two apps. How can i get the server time of any server with an accuracy up to 1ms? or maybe just 10ms?

我想这一些SNTP的客户,但他们给我的只有我的目的地时间或仅与精度可达1秒。

i tried this some SNTP Clients, but they give me only my destination time or only with an accuracy up to 1s.

请帮助。

推荐答案

您需要配置SNTP客户端遵循一个时间服务器在那里。有2种方式来同步你的时间。 SLAM,或转换。

You need to configure your SNTP client to follow a time server out there. There are 2 ways to sync your time. SLAM, or SLEW.

SLAM,只需要在服务器时间和投掷它在客户端上。

SLAM, just takes the server time and throws it on the client.

SLEW,占用服务器时间和纠正你的客户的时间,在接下来的几分钟。

SLEW, takes the server time and corrects your client time, over the next few minutes.

在你的情况,我建议,作为你的应用程序加载,使用SLAM。

In your case, I suggest that, as your application loads, use SLAM.

在uxix,NetWare的世界里,就像的ntpdate 实用程序slaming和 NTPD 的回转。

In the uxix, netware world, there were utilities like ntpdate for slaming, and ntpd for slewing.

SNTP是要走的路,这些客户端已经出现了像15年现在,所以它非常稳定。逸岸新的发展停止像8年回来。所以它应该是非常稳定的。只是需要更多的时间和配置是正确的。

SNTP is the way to go, these clients have been around for like 15 years now, so its very stable. Infact new development stopped like 8 years back. So it ought to be very stable. Just take more time and configure it right.

<一个href=\"https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/net/SntpClient.java\"相对=nofollow> SNTP机器人

这篇关于爪哇,机器人,得到itnernet服务器原子时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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