code: private void sendHeartbeatIfNeeded() {
  		final long nextHeartbeat = lastHeartbeatSupplier.get() + HEARTBEAT;
  
  		if(nextHeartbeat < System.currentTimeMillis()) {
  			logger.debug("Send heartbeat");
  			bitfinexApiBroker.sendCommand(new PingCommand());
  		}
  	}
docs: Send a heartbeat package on the connection