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; }
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); }
static void OnPollComplete(IAsyncResult result) { if (result.CompletedSynchronously) { return; } MakeConnectionPoller <TChannel> thisPtr = (MakeConnectionPoller <TChannel>)result.AsyncState; thisPtr.EndPoll(result); }
static void OnEnsurePollingLater(object state) { MakeConnectionPoller <TChannel> thisPtr = (MakeConnectionPoller <TChannel>)state; try { thisPtr.EnsurePollingCore(); } catch (Exception e) { thisPtr.EnqueueException(e); } }
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); } }