/** * Sends a ping to the server so that the pong response will keep * the channel active in order to avoid a ReadTimeout exception that will * close the channel. */ private void keepAlive() { if (!channel.isOpen()) { log.warn("keepAlive: channel not open, skipping ping. "); return; } sendMessageAndGetCompletable(null, new CorfuMsg(CorfuMsgType.PING)); log.trace("keepAlive: sending ping to {}", this.channel.remoteAddress()); }