public AsyncQueueReader(InputQueue <T> inputQueue, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state) { this.inputQueue = inputQueue; if (timeout != TimeSpan.MaxValue) { this.timer = new Timer(timerCallback, this, timeout, TimeSpan.FromMilliseconds(-1)); } }
public HttpCookieReplySessionChannel(HttpCookieReplySessionChannelListener parent, EndpointAddress localAddress) : base(parent) { this.parent = parent; this.localAddress = localAddress; this.sessionTimeout = parent.SessionTimeout; this.session = new HttpCookieReplySession(); this.requestQueue = new InputQueue <RequestContext>(); }
public HttpCookieReplySessionChannelListener( HttpCookieSessionBindingElement bindingElement, BindingContext context) : base(context.Binding) { this.innerChannelListener = context.BuildInnerChannelListener <IReplyChannel>();; this.sessionTimeout = bindingElement.SessionTimeout; this.exchangeTerminateMessage = bindingElement.ExchangeTerminateMessage; this.channelMapping = new Dictionary <string, HttpCookieReplySessionChannel>(); this.channelQueue = new InputQueue <IReplySessionChannel>(); this.onReceiveRequest = new AsyncCallback(OnReceiveRequest); this.onInnerChannelClosed = new EventHandler(OnInnerChannelClosed); this.onItemDequeued = new ItemDequeuedCallback(OnItemDequeued); }
internal UdpChannelListener(UdpTransportBindingElement bindingElement, BindingContext context) : base(context.Binding) { this.maxMessageSize = (int)bindingElement.MaxReceivedMessageSize; this.multicast = bindingElement.Multicast; this.bufferManager = BufferManager.CreateBufferManager(bindingElement.MaxBufferPoolSize, this.maxMessageSize); this.maxBufferPoolSize = bindingElement.MaxBufferPoolSize; MessageEncodingBindingElement messageEncoderBindingElement = context.BindingParameters.Remove <MessageEncodingBindingElement>(); if (messageEncoderBindingElement != null) { this.messageEncoderFactory = messageEncoderBindingElement.CreateMessageEncoderFactory(); } else { this.messageEncoderFactory = UdpConstants.DefaultMessageEncoderFactory; } this.channelQueue = new InputQueue <IInputChannel>(); this.currentChannelLock = new object(); Uri baseAddress = context.ListenUriBaseAddress; if (baseAddress == null) { if (context.ListenUriMode == ListenUriMode.Unique) { UriBuilder uriBuilder = new UriBuilder(this.Scheme, Dns.GetHostEntry(String.Empty).HostName); uriBuilder.Path = Guid.NewGuid().ToString(); baseAddress = uriBuilder.Uri; } else { throw new InvalidOperationException( "Null is only a supported value for ListenUriBaseAddress when using ListenUriMode.Unique."); } } this.InitializeUri(baseAddress, context.ListenUriRelativeAddress, context.ListenUriMode); }
internal CustomHttpInputChannel(CustomHttpChannelListener listener) : base(listener) { this.encoder = listener.MessageEncoderFactory.Encoder; this.messageQueue = new InputQueue <Message>(); }
public WaitQueueReader(InputQueue <T> inputQueue) { this.inputQueue = inputQueue; waitEvent = new ManualResetEvent(false); }