rev 更新测试读、写未关闭链接
This commit is contained in:
@@ -1099,6 +1099,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
result.add(json);
|
result.add(json);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
server.dispose();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1116,6 +1117,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
}
|
}
|
||||||
Server server = ReadUtil.getServer(opc_id);
|
Server server = ReadUtil.getServer(opc_id);
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
|
server.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
|||||||
Object his = accessor_value.getValue(itemId);
|
Object his = accessor_value.getValue(itemId);
|
||||||
if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) {
|
if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) {
|
||||||
log.warn("opc 值不健康 item: {}, 状态: {}", itemId, itemState.getQuality());
|
log.warn("opc 值不健康 item: {}, 状态: {}", itemId, itemState.getQuality());
|
||||||
|
valueAllNotNull = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!UnifiedDataAppService.isEquals(value, his)) {
|
if (!UnifiedDataAppService.isEquals(value, his)) {
|
||||||
@@ -227,8 +228,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
|||||||
log.warn(tag + "重新创建server");
|
log.warn(tag + "重新创建server");
|
||||||
log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,30000 + random);
|
log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,30000 + random);
|
||||||
}
|
}
|
||||||
// ThreadUtl.sleep((long) (30000 + random));
|
// ThreadUtl.sleep((long) (30000 + random));
|
||||||
ThreadUtl.sleep((long) ((new Random()).nextInt(3) +1) * 1000);
|
ThreadUtl.sleep((long) ((new Random()).nextInt(3) +1) * 10000);
|
||||||
break start;
|
break start;
|
||||||
} else if (this.all_null < 12) {
|
} else if (this.all_null < 12) {
|
||||||
if (log.isWarnEnabled()) {
|
if (log.isWarnEnabled()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user