Esempio n. 1
0
        public MakeConnectionDuplexClientChannel(ChannelManagerBase channelManager, TChannel innerChannel)
            : base(channelManager, innerChannel)
        {
            this.localAddress = new EndpointAddress(string.Concat(MakeConnectionConstants.AnonymousUriTemplate, Guid.NewGuid().ToString()));
            this.poller       = MakeConnectionPoller <TChannel> .AddChannelToPoller(this);

            this.settings = (IMakeConnectionFactorySettings)channelManager;
        }
Esempio n. 2
0
        public static MakeConnectionPoller <TChannel> AddChannelToPoller(MakeConnectionDuplexClientChannel <TChannel> channel)
        {
            MakeConnectionPoller <TChannel> poller = GetForUri(channel.RemoteAddress.Uri);

            poller.AddChannel(channel);
            poller.messageVersion = channel.GetProperty <MessageVersion>();
            return(poller);
        }
Esempio n. 3
0
        static void OnPollComplete(IAsyncResult result)
        {
            if (result.CompletedSynchronously)
            {
                return;
            }

            MakeConnectionPoller <TChannel> thisPtr = (MakeConnectionPoller <TChannel>)result.AsyncState;

            thisPtr.EndPoll(result);
        }
Esempio n. 4
0
        static void OnEnsurePollingLater(object state)
        {
            MakeConnectionPoller <TChannel> thisPtr = (MakeConnectionPoller <TChannel>)state;

            try
            {
                thisPtr.EnsurePollingCore();
            }
            catch (Exception e)
            {
                thisPtr.EnqueueException(e);
            }
        }
Esempio n. 5
0
            public CloseAsyncResult(TimeSpan timeout, MakeConnectionPoller <TChannel> poller, AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.timeoutHelper = new TimeoutHelper(timeout);
                this.poller        = poller;

                this.poller.stopPolling = true;

                if (this.poller.polling)
                {
                    ThreadPool.QueueUserWorkItem(onWaitForStopLater, this);
                }
                else
                {
                    base.Complete(true);
                }
            }