fix: 尝试修复断联问题
This commit is contained in:
parent
e07250637e
commit
0b7789838b
@ -250,21 +250,30 @@ public class RtkClusterService implements ApplicationRunner {
|
||||
}
|
||||
|
||||
if (n > 0 && isLikelyText(probe, n)) {
|
||||
if (!isSocketAlive(outConn)) {
|
||||
Socket previous = outConn;
|
||||
if (!isSocketAlive(previous)) {
|
||||
outConn = s;
|
||||
assigned = true;
|
||||
LOGGER.debug("Endpoint {} OUT connected", port);
|
||||
pumpOut(s, probe, n);
|
||||
} else {
|
||||
LOGGER.info("Endpoint {} additional OUT connection detected; keeping existing", port);
|
||||
LOGGER.info("Endpoint {} replacing existing OUT connection", port);
|
||||
closeQuietly(previous);
|
||||
outConn = s;
|
||||
assigned = true;
|
||||
pumpOut(s, probe, n);
|
||||
}
|
||||
} else {
|
||||
if (!isSocketAlive(inConn)) {
|
||||
Socket previous = inConn;
|
||||
if (!isSocketAlive(previous)) {
|
||||
inConn = s;
|
||||
assigned = true;
|
||||
LOGGER.debug("Endpoint {} IN connected", port);
|
||||
} else {
|
||||
LOGGER.info("Endpoint {} additional IN connection detected; keeping existing", port);
|
||||
LOGGER.info("Endpoint {} replacing existing IN connection", port);
|
||||
closeQuietly(previous);
|
||||
inConn = s;
|
||||
assigned = true;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user