Beispiel #1
0
        public IAsyncResult BeginCreateMessagingFactory(AsyncCallback callback, object state)
        {
            UriBuilder uriBuilder = new UriBuilder(this.endpoint)
            {
                Scheme = "sb://",
                Port   = this.runtimePort
            };

            return(MessagingFactory.BeginCreate(uriBuilder.Uri, this.tokenProvider, callback, state));
        }
 public OpenMessagingFactoryAndMessageSenderAsyncResult(ServiceBusOutputChannel outputChannel, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.timeoutHelper = new TimeoutHelper(timeout);
     this.outputChannel = outputChannel;
     try
     {
         if (base.SyncContinue(MessagingFactory.BeginCreate(this.outputChannel.messagingAddress.ResourceAddress, this.outputChannel.messagingFactorySettings, this.timeoutHelper.RemainingTime(), base.PrepareAsyncCompletion(ServiceBusOutputChannel.OpenMessagingFactoryAndMessageSenderAsyncResult.createFactoryComplete), this)))
         {
             base.Complete(true);
         }
     }
     catch (MessagingException messagingException1)
     {
         MessagingException messagingException = messagingException1;
         throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.AsError(MessagingExceptionHelper.ConvertToCommunicationException(messagingException), null);
     }
 }