This commit is contained in:
Redkale
2018-04-02 16:28:21 +08:00
parent 09c51b6b4e
commit 7bf8d60ddf

View File

@@ -41,11 +41,13 @@ public class WebSocketNodeService extends WebSocketNode implements Service {
if (localSncpAddress == null || !localSncpAddress.equals(targetAddress)) return remoteWebSocketAddresses(targetAddress, groupid);
if (this.localEngine == null) return CompletableFuture.completedFuture(new ArrayList<>());
ExecutorService executor = ForkJoinPool.commonPool();
ExecutorService executor = null;
Thread thread = Thread.currentThread();
if (thread instanceof WorkThread) {
executor = ((WorkThread) thread).getExecutor();
}
if (executor == null) executor = ForkJoinPool.commonPool();
return CompletableFuture.supplyAsync(() -> {
final List<String> rs = new ArrayList<>();
this.localEngine.getLocalWebSockets(groupid).forEach(x -> rs.add(x.getRemoteAddr()));