forked from KNEMC/KLALB
KLALB V3.6.0 写了一半
This commit is contained in:
@@ -25,6 +25,7 @@ import org.kne.cloud.clock.HighAccuracyClock;
|
||||
import org.kne.cloud.clock.NTPTimestamps;
|
||||
import org.kne.cloud.network.MultipurposeSocketAddress;
|
||||
import org.kne.io.KNEChannels;
|
||||
import org.kne.math.Long128;
|
||||
|
||||
public class NTPv4Protocol implements Closeable, AutoCloseable {
|
||||
private static final boolean showPacket = false;
|
||||
@@ -134,10 +135,10 @@ public class NTPv4Protocol implements Closeable, AutoCloseable {
|
||||
|
||||
private static class CheckListItem {
|
||||
private NTPPeer peer;
|
||||
private BigInteger timeStamp;
|
||||
private Long128 timeStamp;
|
||||
private long createTime = System.nanoTime();
|
||||
|
||||
private CheckListItem(BigInteger timeStamp, NTPPeer peer) {
|
||||
private CheckListItem(Long128 timeStamp, NTPPeer peer) {
|
||||
this.timeStamp = timeStamp;
|
||||
this.peer = peer;
|
||||
}
|
||||
@@ -188,7 +189,7 @@ public class NTPv4Protocol implements Closeable, AutoCloseable {
|
||||
stratum = 0;
|
||||
}
|
||||
nv4.setStratum(stratum);
|
||||
BigInteger precision = context.getLocalPrecision();
|
||||
Long128 precision = context.getLocalPrecision();
|
||||
byte b = (byte) Math.ceil(log(precision.doubleValue() / (Math.pow(2, 64)), 2));
|
||||
nv4.setPrecision(b);
|
||||
nv4.setRootDelay((int) context.getRootDelay());
|
||||
@@ -253,7 +254,7 @@ public class NTPv4Protocol implements Closeable, AutoCloseable {
|
||||
private NTPPeer checkOriginTimestamp(NTPv4Packet nv4) {
|
||||
checkLock.lock();
|
||||
try {
|
||||
BigInteger ori = nv4.getOriginateTimestamp128();
|
||||
Long128 ori = nv4.getOriginateTimestamp128();
|
||||
removeTimeoutTimestamp();
|
||||
for (Iterator<CheckListItem> iterator = checkList.iterator(); iterator.hasNext();) {
|
||||
CheckListItem item = (CheckListItem) iterator.next();
|
||||
|
||||
Reference in New Issue
Block a user