protected override IEnumerable <MessageSession> OnEndGetMessageSessions(IAsyncResult result) { IEnumerable <MessageSession> messageSessions; try { messageSessions = GetMessageSessionsAsyncResult.End(result); } catch (CommunicationException communicationException1) { CommunicationException communicationException = communicationException1; throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.AsError(MessagingExceptionHelper.Unwrap(communicationException, base.IsClosedOrClosing), null); } catch (Exception exception1) { Exception exception = exception1; if (!Fx.IsFatal(exception) && base.IsClosedOrClosing) { throw new OperationCanceledException(SRClient.EntityClosedOrAborted, exception); } throw; } return(messageSessions); }
protected override IAsyncResult OnBeginGetMessageSessions(DateTime lastUpdateTime, AsyncCallback callback, object state) { IAsyncResult getMessageSessionsAsyncResult; try { getMessageSessionsAsyncResult = new GetMessageSessionsAsyncResult((SbmpMessagingFactory)base.MessagingFactory, base.SubscriptionPath, lastUpdateTime, this.ControlMessageCreator.Value, base.RetryPolicy, MessagingEntityType.Subscriber, this.OperationTimeout, callback, state); } catch (CommunicationException communicationException1) { CommunicationException communicationException = communicationException1; throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.AsError(MessagingExceptionHelper.Unwrap(communicationException, base.IsClosedOrClosing), null); } catch (Exception exception1) { Exception exception = exception1; if (!Fx.IsFatal(exception) && base.IsClosedOrClosing) { throw new OperationCanceledException(SRClient.EntityClosedOrAborted, exception); } throw; } return(getMessageSessionsAsyncResult); }