private void authenticateAndWait ( final CountDownLatch latch ) throws InterruptedException , BitfinexClientException { if ( authenticated ) { return ; } sendCommand ( new AuthCommand ( configuration . getAuthNonceProducer ( ) ) ) ; logger . debug ( "Waiting for connection ready events" ) ; latch . await ( 10 , TimeUnit . SECONDS ) ; if ( ! authenticated ) { throw new BitfinexClientException ( "Unable to perform authentication, permissions are: " + permissions ) ; } }
Execute the authentication and wait until the socket is ready