fix: 排查TCP SERVER 发布RTCM消息的断联问题
This commit is contained in:
parent
499cbd663b
commit
fb095ad52c
@ -288,15 +288,31 @@ public class RtkClusterService implements ApplicationRunner {
|
||||
|
||||
private void dequeueLoop() {
|
||||
byte[] pending = null;
|
||||
boolean lastWaitLogged = false;
|
||||
while (true) {
|
||||
try {
|
||||
Socket out = outConn;
|
||||
Socket sink = inConn;
|
||||
if (sink == null || sink.isClosed() || sink == outConn) {
|
||||
// wait for a valid IN sink before consuming queue
|
||||
ensureInCandidate();
|
||||
Thread.sleep(20);
|
||||
if (out == null) {
|
||||
// wait until OUT连接已就绪(rtkrcv 已输出首包/特征头)
|
||||
if (!lastWaitLogged) {
|
||||
LOGGER.info("Endpoint {} waiting for OUT to be ready before sending RTCM", port);
|
||||
lastWaitLogged = true;
|
||||
}
|
||||
Thread.sleep(50);
|
||||
continue;
|
||||
}
|
||||
if (sink == null || sink.isClosed() || sink == out) {
|
||||
// 等待有效的 IN 连接(且不能与 OUT 相同)
|
||||
if (!lastWaitLogged) {
|
||||
LOGGER.info("Endpoint {} waiting for IN to be ready before sending RTCM", port);
|
||||
lastWaitLogged = true;
|
||||
}
|
||||
ensureInCandidate();
|
||||
Thread.sleep(50);
|
||||
continue;
|
||||
}
|
||||
lastWaitLogged = false;
|
||||
if (pending == null) {
|
||||
pending = rtcmQueue.pollFirst(100, TimeUnit.MILLISECONDS);
|
||||
if (pending == null) continue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user