Пример #1
0
 public void Connect()
 {
     try {
         EsConnection.ConnectAsync().Wait();
     }
     catch (AggregateException aggregate) {
         if (aggregate.InnerException is ES.Exceptions.CannotEstablishConnectionException)
         {
             throw new CannotEstablishConnectionException(aggregate.InnerException.Message, aggregate.InnerException);
         }
         throw;
     }
 }
Пример #2
0
 public void Connect()
 {
     if (_connected)
     {
         return;
     }
     try {
         EsConnection.ConnectAsync().Wait();
         _connected = true;
     }
     catch (AggregateException aggregate) {
         if (aggregate.InnerException is CannotEstablishConnectionException)
         {
             throw new CannotEstablishConnectionException(aggregate.InnerException.Message, aggregate.InnerException);
         }
         throw;
     }
 }
 public void Connect()
 {
     _conn.ConnectAsync().Wait();
 }