[change] 修改因PAD和工控机时间不同步引起的超时问题,引起此问题是由于初始化使用了PAD时间,计算时差时间使用了工控时间导致
This commit is contained in:
@@ -95,7 +95,6 @@ public class ReceiveTimeoutManager {
|
||||
public synchronized void start() {
|
||||
if (isEnable.get())
|
||||
if (timer == null) {
|
||||
refreshLast(System.currentTimeMillis() / 1000.0D);
|
||||
timeoutPeriod = ((long) lastReceiveTime * 1000) + timeout;
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@@ -103,8 +102,7 @@ public class ReceiveTimeoutManager {
|
||||
public void run() {
|
||||
long difference = timeoutPeriod - ((long) lastReceiveTime * 1000);
|
||||
timeoutPeriod = ((long) lastReceiveTime * 1000) + timeout;
|
||||
CupidLogUtils.e(TAG, "最后一次接收时间=" + lastReceiveTime + "秒");
|
||||
CupidLogUtils.e(TAG, "最后一次接收工控机数据时间与当前时间差=" + (difference / 1000.0) + "秒");
|
||||
CupidLogUtils.e(TAG, "最后一次接收时间=" + lastReceiveTime + " 时间差=" + difference + "ms");
|
||||
if (difference >= timeout) {
|
||||
if (listener != null) {
|
||||
listener.onTimeout(difference / 1000.0);
|
||||
|
||||
Reference in New Issue
Block a user