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