in kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java [72:90]
private int openSocket(final int port) throws IOException {
closed = false;
serverSocket = new ServerSocket(port);
int localPort = serverSocket.getLocalPort();
String threadName = String.format("elasticjob-snapshot-service-%d", localPort);
new Thread(() -> {
while (!closed) {
try {
process(serverSocket.accept());
} catch (final IOException ex) {
if (isIgnoredException()) {
return;
}
log.error("ElasticJob: Snapshot service open socket failure, error is: ", ex);
}
}
}, threadName).start();
return localPort;
}