Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / MsmqInputChannelListenerBase.cs / 1 / MsmqInputChannelListenerBase.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { abstract class MsmqInputChannelListenerBase : MsmqChannelListenerBase{ InputQueueChannelAcceptor acceptor; internal MsmqInputChannelListenerBase(MsmqBindingElementBase bindingElement, BindingContext context, MsmqReceiveParameters receiveParameters) : this(bindingElement, context, receiveParameters, TransportDefaults.GetDefaultMessageEncoderFactory()) {} internal MsmqInputChannelListenerBase(MsmqBindingElementBase bindingElement, BindingContext context, MsmqReceiveParameters receiveParameters, MessageEncoderFactory encoderFactory) : base(bindingElement, context, receiveParameters, encoderFactory) { this.acceptor = new InputQueueChannelAcceptor (this); } void OnNewChannelNeeded(object sender, EventArgs ea) { if (! this.IsDisposed && (CommunicationState.Opened == this.State || CommunicationState.Opening == this.State)) { IInputChannel inputChannel = CreateInputChannel(this); inputChannel.Closed += OnNewChannelNeeded; this.acceptor.EnqueueAndDispatch(inputChannel); } } protected override void OnOpenCore(TimeSpan timeout) { base.OnOpenCore(timeout); this.acceptor.Open(); OnNewChannelNeeded(this, EventArgs.Empty); } protected override void OnCloseCore(bool aborting) { this.acceptor.Close(); base.OnCloseCore(aborting); } protected abstract IInputChannel CreateInputChannel(MsmqInputChannelListenerBase listener); // AcceptChannel public override IInputChannel AcceptChannel() { return AcceptChannel(this.DefaultReceiveTimeout); } // public override IAsyncResult BeginAcceptChannel(AsyncCallback callback, object state) { return BeginAcceptChannel(this.DefaultReceiveTimeout, callback, state); } // public override IInputChannel AcceptChannel(TimeSpan timeout) { return this.acceptor.AcceptChannel(timeout); } // public override IAsyncResult BeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state) { return this.acceptor.BeginAcceptChannel(timeout, callback, state); } // public override IInputChannel EndAcceptChannel(IAsyncResult result) { return this.acceptor.EndAcceptChannel(result); } // WaitForChannel protected override bool OnWaitForChannel(TimeSpan timeout) { return this.acceptor.WaitForChannel(timeout); } // protected override IAsyncResult OnBeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state) { return this.acceptor.BeginWaitForChannel(timeout, callback, state); } // protected override bool OnEndWaitForChannel(IAsyncResult result) { return this.acceptor.EndWaitForChannel(result); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewSelectedRowCollection.cs
- EtwTrace.cs
- BuilderInfo.cs
- XmlSchemaAppInfo.cs
- ListBase.cs
- TrackingMemoryStream.cs
- Simplifier.cs
- RelatedImageListAttribute.cs
- TableCellCollection.cs
- Msec.cs
- TextEditorThreadLocalStore.cs
- CheckBoxRenderer.cs
- PeerPresenceInfo.cs
- SpoolingTask.cs
- Delegate.cs
- Typeface.cs
- HttpHandlerActionCollection.cs
- WebResourceAttribute.cs
- SafeNativeMethods.cs
- RuleSettingsCollection.cs
- ViewManager.cs
- SafeLibraryHandle.cs
- ClientFormsAuthenticationCredentials.cs
- Identity.cs
- NamespaceCollection.cs
- ConfigurationProperty.cs
- TypeDelegator.cs
- Reference.cs
- MultiplexingFormatMapping.cs
- SpellerError.cs
- streamingZipPartStream.cs
- sortedlist.cs
- WebBrowser.cs
- FileChangesMonitor.cs
- BasePattern.cs
- cookie.cs
- ScrollBar.cs
- DeferrableContent.cs
- SeekableReadStream.cs
- LogStore.cs
- PolygonHotSpot.cs
- shaper.cs
- ContextBase.cs
- IPEndPointCollection.cs
- Site.cs
- SiteMapPath.cs
- BinaryKeyIdentifierClause.cs
- DataGridTextBox.cs
- SspiNegotiationTokenProvider.cs
- DSACryptoServiceProvider.cs
- ApplicationManager.cs
- LineBreak.cs
- BaseTransportHeaders.cs
- FrameworkElementFactory.cs
- FtpWebResponse.cs
- HtmlProps.cs
- CodeDirectoryCompiler.cs
- WebHeaderCollection.cs
- IndexingContentUnit.cs
- StylusCollection.cs
- OdbcFactory.cs
- IResourceProvider.cs
- DateTimeConverter2.cs
- Brush.cs
- SelectionGlyph.cs
- BaseCodePageEncoding.cs
- FixedBufferAttribute.cs
- IISUnsafeMethods.cs
- ProtectedProviderSettings.cs
- RIPEMD160Managed.cs
- FormViewModeEventArgs.cs
- EntityStoreSchemaFilterEntry.cs
- WebPartConnectVerb.cs
- DragEvent.cs
- CompilerGlobalScopeAttribute.cs
- TreeNodeSelectionProcessor.cs
- TabItem.cs
- XPathDocumentNavigator.cs
- ParameterCollection.cs
- TransformerTypeCollection.cs
- AttachedPropertyInfo.cs
- ForeignConstraint.cs
- TypeHelper.cs
- XmlSerializerAssemblyAttribute.cs
- StdValidatorsAndConverters.cs
- FileNotFoundException.cs
- RulePatternOps.cs
- TabRenderer.cs
- ContentTextAutomationPeer.cs
- CodeDefaultValueExpression.cs
- TextRangeProviderWrapper.cs
- StringFunctions.cs
- IsolationInterop.cs
- ListViewGroup.cs
- XmlDocumentSerializer.cs
- AssemblyBuilder.cs
- ByteAnimationBase.cs
- MergeLocalizationDirectives.cs
- ResourceDescriptionAttribute.cs
- XmlSchemaProviderAttribute.cs