Revert "fix: 尝试修复断联问题"

This reverts commit 0b7789838bb6cc63d4d6775ef764b7073d451ca6.
This commit is contained in:
yarnom 2025-10-29 10:34:55 +08:00
parent 2a9ab127c5
commit c252b11d3c

View File

@ -250,30 +250,21 @@ public class RtkClusterService implements ApplicationRunner {
}
if (n > 0 && isLikelyText(probe, n)) {
Socket previous = outConn;
if (!isSocketAlive(previous)) {
if (!isSocketAlive(outConn)) {
outConn = s;
assigned = true;
LOGGER.debug("Endpoint {} OUT connected", port);
pumpOut(s, probe, n);
} else {
LOGGER.info("Endpoint {} replacing existing OUT connection", port);
closeQuietly(previous);
outConn = s;
assigned = true;
pumpOut(s, probe, n);
LOGGER.info("Endpoint {} additional OUT connection detected; keeping existing", port);
}
} else {
Socket previous = inConn;
if (!isSocketAlive(previous)) {
if (!isSocketAlive(inConn)) {
inConn = s;
assigned = true;
LOGGER.debug("Endpoint {} IN connected", port);
} else {
LOGGER.info("Endpoint {} replacing existing IN connection", port);
closeQuietly(previous);
inConn = s;
assigned = true;
LOGGER.info("Endpoint {} additional IN connection detected; keeping existing", port);
}
}
} catch (IOException e) {