protected ResolveRequestResponseAsyncResult(
            TResolveMessage resolveMessage,
            IDiscoveryServiceImplementation discoveryServiceImpl,
            AsyncCallback callback,
            object state)
            : base(callback, state)
        {
            Fx.Assert(resolveMessage != null, "The resolveMessage must be non null.");
            Fx.Assert(discoveryServiceImpl != null, "The discoveryServiceImpl must be non null.");

            this.discoveryServiceImpl = discoveryServiceImpl;

            if (!this.Validate(resolveMessage))
            {
                this.Complete(true);
                return;
            }
            else
            {
                this.context         = new DiscoveryOperationContext(OperationContext.Current);
                this.resolveCriteria = this.GetResolveCriteria(resolveMessage);
                if (this.ProcessResolveRequest())
                {
                    this.Complete(true);
                    return;
                }
            }
        }
Ejemplo n.º 2
0
        protected ResolveDuplexAsyncResult(TResolveMessage resolveMessage,
                                           IDiscoveryServiceImplementation discoveryServiceImpl,
                                           IMulticastSuppressionImplementation multicastSuppressionImpl,
                                           AsyncCallback callback,
                                           object state)
            : base(callback, state)
        {
            Fx.Assert(resolveMessage != null, "The resolveMessage must be non null.");
            Fx.Assert(discoveryServiceImpl != null, "The discoveryServiceImpl must be non null.");

            this.discoveryServiceImpl     = discoveryServiceImpl;
            this.multicastSuppressionImpl = multicastSuppressionImpl;

            if (!this.Validate(resolveMessage))
            {
                this.Complete(true);
                return;
            }
            else
            {
                this.context         = new DiscoveryOperationContext(OperationContext.Current);
                this.resolveCriteria = this.GetResolveCriteria(resolveMessage);
                this.timeoutHelper   = new TimeoutHelper(this.resolveCriteria.Duration);
                this.timeoutHelper.RemainingTime();
                this.Process();
            }
        }
        protected ProbeRequestResponseAsyncResult(
            TProbeMessage probeMessage,
            IDiscoveryServiceImplementation discoveryServiceImpl,
            AsyncCallback callback,
            object state)
            : base(callback, state)
        {
            Fx.Assert(probeMessage != null, "The probeMessage must be non null.");
            Fx.Assert(discoveryServiceImpl != null, "The discoveryServiceImpl must be non null.");

            this.discoveryServiceImpl = discoveryServiceImpl;
            this.findCompletedLock    = new object();

            if (!this.Validate(probeMessage))
            {
                this.Complete(true);
                return;
            }
            else
            {
                this.context     = new DiscoveryOperationContext(OperationContext.Current);
                this.findRequest = new FindRequestResponseContext(this.GetFindCriteria(probeMessage), this);
                if (this.ProcessFindRequest())
                {
                    this.Complete(true);
                    return;
                }
            }
        }
 void EnsureOutgoingMessageHeaders()
 {
     if (this.outgoingMessageHeaders == null)
     {
         lock (this.thisLock)
         {
             if (this.outgoingMessageHeaders == null)
             {
                 this.outgoingMessageHeaders = DiscoveryOperationContext.GetOutgoingMessageHeaders(this.operationContext);
             }
         }
     }
 }
        public DiscoveryOperationContext(OperationContext operationContext)
        {
            Fx.Assert(operationContext != null, "The operationContext must be non null.");

            if (Fx.Trace.IsEtwProviderEnabled)
            {
                this.eventTraceActivity = EventTraceActivityHelper.TryExtractActivity(operationContext.IncomingMessage);
            }

            this.operationContext          = operationContext;
            this.operationContextExtension = DiscoveryOperationContext.GetDiscoveryOperationContextExtension(this.operationContext);
            this.messageProperty           = DiscoveryOperationContext.GetDiscoveryMessageProperty(this.operationContext);

            this.thisLock = new object();
        }