1、2410207改回UDP推送,TCP没起作用,反而有更多的连续无固定解

This commit is contained in:
weidong 2024-05-04 11:09:21 +08:00
parent 972f438344
commit 13510559c8

View File

@ -44,16 +44,12 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
if(device1.getOpMode() == GnssDevice.OP_MODE_USE) {
byte[] forwardBytes = message.getSrcData();
boolean useUDPChannel = true;
if(device1.getDeviceId().equals("2410207")) useUDPChannel = false;
// 要求快速转发因此用缓存不要每次都查数据库
List<Device> deviceList = deviceService.findByParentId(id);
for (Device device : deviceList) {
if (device.getOpMode() != GnssDevice.OP_MODE_USE) continue;
String deviceId = device.getDeviceId();
DeviceChannel deviceChannel =
useUDPChannel?OnlineChannels.INSTANCE.getDataChannel(deviceId):OnlineChannels.INSTANCE.getConfigChannel(deviceId);
if(deviceChannel!=null) {
OnlineChannels.INSTANCE.get(deviceId).ifPresent(deviceChannel -> {
if (logger.isDebugEnabled()) {
logger.debug("forward d331 rtcm message to device {}", deviceId);
}
@ -63,7 +59,7 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
ByteBuf buf = Unpooled.buffer();
buf.writeBytes(forwardBytes);
deviceChannel.writeAndFlush(buf);
}
});
}
}