예제 #1
0
 private void OpenedAsyncHandler(IAsyncResult res)
 {
     try
     {
         _channel.EndOpen(res);
         if (_channel.State == CommunicationState.Opened)
             OnOpened();
         else
             Close();
     }
     catch (CommunicationException cex)
     {
         Logger.Logger.Instance.Debug(cex, "Error during opening the connection to " + TargetName);
         OnClosed();
     }
     catch (TimeoutException tex)
     {
         Logger.Logger.Instance.Debug(tex, "Error during opening the connection to " + TargetName);
         OnClosed();
     }
 }