use of io.vertx.core.eventbus.impl.codecs.PingMessageCodec in project vert.x by eclipse.
the class ConnectionHolder method schedulePing.
private void schedulePing() {
EventBusOptions options = eventBus.options();
pingTimeoutID = vertx.setTimer(options.getClusterPingInterval(), id1 -> {
timeoutID = vertx.setTimer(options.getClusterPingReplyInterval(), id2 -> {
log.warn("No pong from server " + serverID + " - will consider it dead");
close();
});
ClusteredMessage pingMessage = new ClusteredMessage<>(serverID, PING_ADDRESS, null, null, null, new PingMessageCodec(), true, eventBus);
Buffer data = pingMessage.encodeToWire();
socket.write(data);
});
}
Aggregations