public boolean connectToBroker(final MqttAsyncConnection connection){
  try {
    connection.connect(new MqttCallbackHandler(connection),new MqttAsyncConnectionRunnable(connection));
    return true;
  }
 catch (  SpyException e) {
    Platform.runLater(new MqttEventHandler(new MqttConnectionAttemptFailureEvent(connection,e)));
    logger.error(e.getMessage(),e);
  }
  return false;
}

public boolean connectToBroker ( final MqttAsyncConnection connection ) { try { connection . connect ( new MqttCallbackHandler ( connection ) , new MqttAsyncConnectionRunnable ( connection ) ) ; return true ; } catch ( SpyException e ) { Platform . runLater ( new MqttEventHandler ( new MqttConnectionAttemptFailureEvent ( connection , e ) ) ) ; logger . error ( e . getMessage ( ) , e ) ; } return false ; }
connects the specified connection to a broker .
