mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] WebSocket ping
This commit is contained in:
parent
3c5a83736b
commit
e1eaad2cd0
1 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,8 @@
|
|||
import io.netty.util.CharsetUtil;
|
||||
import ru.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class WebSocketClientHandler extends SimpleChannelInboundHandler<Object> {
|
||||
|
||||
private final WebSocketClientHandshaker handshaker;
|
||||
|
@ -30,6 +32,9 @@ public void handlerAdded(final ChannelHandlerContext ctx) throws Exception {
|
|||
public void channelActive(final ChannelHandlerContext ctx) throws Exception {
|
||||
handshaker.handshake(ctx.channel());
|
||||
clientJSONPoint.onOpen();
|
||||
ctx.executor().schedule(() -> {
|
||||
ctx.channel().writeAndFlush(new PingWebSocketFrame());
|
||||
}, 20L, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue