Ejemplo n.º 1
0
 private void SetState(TrackingContext trackingContext, Stream stream)
 {
     if (trackingContext == null)
     {
         trackingContext = TrackingContext.GetInstance(Guid.NewGuid(), this.Path);
     }
     MessageSession.TraceSetState(EventTraceActivity.CreateFromThread(), trackingContext, this.SessionId);
     this.OnSetState(trackingContext, stream, this.OperationTimeout);
 }
Ejemplo n.º 2
0
        public IAsyncResult BeginSetState(Stream stream, AsyncCallback callback, object state)
        {
            IAsyncResult asyncResult;

            base.ThrowIfDisposed();
            try
            {
                TrackingContext instance = TrackingContext.GetInstance(Guid.NewGuid(), this.Path);
                MessageSession.TraceSetState(EventTraceActivity.CreateFromThread(), instance, this.SessionId);
                MessageSession.RetrySessionAsyncResult retrySessionAsyncResult = new MessageSession.RetrySessionAsyncResult(this, instance, MessageSession.SessionOperation.SetState, stream, this.OperationTimeout, callback, state);
                retrySessionAsyncResult.Start();
                asyncResult = retrySessionAsyncResult;
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                if (!Fx.IsFatal(exception))
                {
                    throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.AsError(exception, null);
                }
                throw;
            }
            return(asyncResult);
        }