예제 #1
0
 public ConnectAsyncResult(PipeConnectionInitiator parent, Uri remoteUri, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.parent        = parent;
     this.remoteUri     = remoteUri;
     this.timeoutHelper = new TimeoutHelper(timeout);
     parent.PrepareConnect(remoteUri, this.timeoutHelper.RemainingTime(), out this.resolvedAddress, out this.backoffHelper);
     if (this.ConnectAndWait())
     {
         base.Complete(true);
     }
 }
예제 #2
0
            protected override string GetPoolKey(EndpointAddress address, Uri via)
            {
                string pipeName;

                lock (base.ThisLock)
                {
                    if (!this.pipeNameCache.TryGetValue(via, out pipeName))
                    {
                        pipeName = PipeConnectionInitiator.GetPipeName(via);
                        this.pipeNameCache.Add(via, pipeName);
                    }
                }
                return(pipeName);
            }
예제 #3
0
            protected override string GetPoolKey(EndpointAddress address, Uri via)
            {
                string result;

                lock (base.ThisLock)
                {
                    if (!this.pipeNameCache.TryGetValue(via, out result))
                    {
                        result = PipeConnectionInitiator.GetPipeName(via, this.transportFactorySettings);
                        this.pipeNameCache.Add(via, result);
                    }
                }
                return(result);
            }
예제 #4
0
            public ConnectAsyncResult(PipeConnectionInitiator parent, Uri remoteUri, TimeSpan timeout,
                AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.parent = parent;
                this.remoteUri = remoteUri;
                this.timeoutHelper = new TimeoutHelper(timeout);
                parent.PrepareConnect(remoteUri, this.timeoutHelper.RemainingTime(), out this.resolvedAddress, out this.backoffHelper);

                if (this.ConnectAndWait())
                {
                    this.Complete(true);
                }
            }