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 (n > 0 && isLikelyText(probe, n)) {
|
||||||
if (!isSocketAlive(outConn)) {
|
Socket previous = outConn;
|
||||||
|
if (!isSocketAlive(previous)) {
|
||||||
outConn = s;
|
outConn = s;
|
||||||
assigned = true;
|
assigned = true;
|
||||||
LOGGER.debug("Endpoint {} OUT connected", port);
|
LOGGER.debug("Endpoint {} OUT connected", port);
|
||||||
pumpOut(s, probe, n);
|
pumpOut(s, probe, n);
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
if (!isSocketAlive(inConn)) {
|
Socket previous = inConn;
|
||||||
|
if (!isSocketAlive(previous)) {
|
||||||
inConn = s;
|
inConn = s;
|
||||||
assigned = true;
|
assigned = true;
|
||||||
LOGGER.debug("Endpoint {} IN connected", port);
|
LOGGER.debug("Endpoint {} IN connected", port);
|
||||||
} else {
|
} 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) {
|
} catch (IOException e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user