long nextDelay = timeToHeartBeatMillis - (currentTime - lastIoTime);
if(peerConnection!=null && nextDelay <= 0) {
LOG.debug("sending heart beat to {}, {}", peerConnection.remotePeer(),
(peerConnection.channelFuture() != null ? peerConnection.channelFuture().channel() : null));
PingBuilder builder = pingBuilderFactory.create();
BaseFuture baseFuture = builder.peerConnection(peerConnection).start();
builder.notifyAutomaticFutures(baseFuture);
} else {
LOG.debug("Not sending heart beat to {}, {}", peerConnection.remotePeer(),
(peerConnection.channelFuture() != null ? peerConnection.channelFuture().channel() : null));
}
}