Exemplo n.º 1
0
            private void EndAcceptMessageSessionBrowser(IAsyncResult result)
            {
                AcceptMessageSessionBrowserAsyncResult acceptMessageSessionBrowserAsyncResult = (AcceptMessageSessionBrowserAsyncResult)result;

                this.sbmpMessageSession = (SbmpBrowsableMessageSession)AcceptMessageSessionBrowserAsyncResult.End(result);
                this.SessionState       = acceptMessageSessionBrowserAsyncResult.SessionState;
            }
Exemplo n.º 2
0
 public PeekMessagesAsyncResult(SbmpBrowsableMessageSession sbmpMessageSession, TrackingContext trackingContext, long fromSequenceNumber, int messageCount, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.sbmpMessageSession = sbmpMessageSession;
     this.trackingContext    = trackingContext;
     this.fromSequenceNumber = fromSequenceNumber;
     this.messageCount       = messageCount;
     base.Start();
 }
        public AcceptMessageSessionBrowserAsyncResult(SbmpBrowsableMessageSession messageSession, SbmpMessagingFactory messagingFactory, MessagingEntityType?entityType, ReceiveMode receiveMode, int prefetchCount, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
        {
            this.messageSession   = messageSession;
            this.sessionId        = messageSession.SessionId;
            this.MessagingFactory = messagingFactory;
            string   path     = messageSession.Path;
            LinkInfo linkInfo = new LinkInfo()
            {
                LinkId            = messagingFactory.GetNextLinkId(),
                ConnectionId      = messagingFactory.ConnectionId,
                LinkType          = LinkType.Receive,
                IsSessionReceiver = true,
                ReceiveMode       = receiveMode,
                EntityName        = path,
                EntityType        = entityType,
                SessionId         = messageSession.SessionId
            };

            this.createLinkSettings = new CreateLinkSettings(messagingFactory, path, path, linkInfo, null);
            AcceptMessageSessionCommand acceptMessageSessionCommand = new AcceptMessageSessionCommand()
            {
                SessionId        = this.sessionId,
                Timeout          = timeout,
                PrefetchCount    = prefetchCount,
                IsSessionBrowser = true
            };
            AcceptMessageSessionCommand acceptMessageSessionCommand1 = acceptMessageSessionCommand;
            RequestInfo requestInfo = new RequestInfo()
            {
                ServerTimeout = new TimeSpan?(acceptMessageSessionCommand1.Timeout),
                SessionId     = acceptMessageSessionCommand1.SessionId
            };
            RequestInfo requestInfo1 = requestInfo;
            Message     message      = this.createLinkSettings.MessageCreator.CreateWcfMessage("http://schemas.microsoft.com/netservices/2011/06/servicebus/SbmpMessageReceiver/AcceptMessageSession", acceptMessageSessionCommand1, null, this.messageSession.RetryPolicy, null, requestInfo1);

            if (base.SyncContinue(this.MessagingFactory.Channel.BeginRequest(message, SbmpProtocolDefaults.BufferTimeout(timeout, this.MessagingFactory.GetSettings().EnableAdditionalClientTimeout), base.PrepareAsyncCompletion(AcceptMessageSessionBrowserAsyncResult.operationComplete), this)))
            {
                base.Complete(true);
            }
        }
Exemplo n.º 4
0
 private void EndAcceptMessageSessionBrowser(IAsyncResult result)
 {
     this.sbmpMessageSession = (SbmpBrowsableMessageSession)AcceptMessageSessionBrowserAsyncResult.End(result);
 }
Exemplo n.º 5
0
 public GetStateAsyncResult(SbmpBrowsableMessageSession sbmpMessageSession, TrackingContext trackingContext, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state)
 {
     this.sbmpMessageSession = sbmpMessageSession;
     this.trackingContext    = trackingContext;
     base.Start();
 }