From 211b440b8bec7661aa70dad439bcfe257e7d7b37 Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 15 Sep 2020 18:09:22 +0700 Subject: [PATCH] [FIX] Server-side pings --- .../launchserver/socket/handlers/WebSocketFrameHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java index e891cf28..7af62164 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java @@ -53,9 +53,9 @@ public void channelActive(ChannelHandlerContext ctx) { client = new Client(null); Channel ch = ctx.channel(); service.registerClient(ch); - ctx.executor().schedule(() -> { + ctx.executor().scheduleAtFixedRate(() -> { ch.writeAndFlush(new PingWebSocketFrame(), ch.voidPromise()); - }, 30L, TimeUnit.SECONDS); + }, 30L , 30L, TimeUnit.SECONDS); } @Override