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
- IndexedWhereQueryOperator.cs
- BCLDebug.cs
- RegexCaptureCollection.cs
- QueryPageSettingsEventArgs.cs
- SqlInternalConnectionSmi.cs
- WindowCollection.cs
- Panel.cs
- DataGridTextBoxColumn.cs
- DataFormats.cs
- CodeCompiler.cs
- PolyBezierSegmentFigureLogic.cs
- DynamicPropertyReader.cs
- MediaSystem.cs
- WebColorConverter.cs
- EntityConnection.cs
- ValueUnavailableException.cs
- WebServiceTypeData.cs
- DataGridViewSelectedRowCollection.cs
- MenuItemStyle.cs
- DataControlImageButton.cs
- EventHandlerList.cs
- PeerNode.cs
- ProgressChangedEventArgs.cs
- PageStatePersister.cs
- MatrixKeyFrameCollection.cs
- Trace.cs
- ExtendedPropertyCollection.cs
- ScrollChrome.cs
- XmlResolver.cs
- BaseTreeIterator.cs
- Matrix3D.cs
- FixedFlowMap.cs
- AutomationPatternInfo.cs
- DockingAttribute.cs
- odbcmetadatacolumnnames.cs
- ContentAlignmentEditor.cs
- NetPipeSection.cs
- PageCache.cs
- SmtpAuthenticationManager.cs
- SerializationObjectManager.cs
- Mapping.cs
- FontConverter.cs
- ScriptControlManager.cs
- DefaultWorkflowSchedulerService.cs
- TimeSpanStorage.cs
- WebPartTransformerCollection.cs
- BufferedReadStream.cs
- X509AudioLogo.cs
- BooleanFacetDescriptionElement.cs
- PrefixQName.cs
- BaseDataListDesigner.cs
- UnsafeNativeMethodsTablet.cs
- autovalidator.cs
- InlineCollection.cs
- BitmapPalette.cs
- PersianCalendar.cs
- CodeBinaryOperatorExpression.cs
- WindowsIdentity.cs
- DataContractSerializer.cs
- ExtensibleClassFactory.cs
- VectorAnimationUsingKeyFrames.cs
- MenuBindingsEditorForm.cs
- __Filters.cs
- ReadOnlyCollection.cs
- Filter.cs
- PropertyMetadata.cs
- BitmapPalettes.cs
- SiteMapNodeItem.cs
- Parser.cs
- MergeLocalizationDirectives.cs
- StylusCaptureWithinProperty.cs
- VectorCollectionValueSerializer.cs
- CellLabel.cs
- StyleSheetComponentEditor.cs
- TimersDescriptionAttribute.cs
- MgmtResManager.cs
- ClientEventManager.cs
- InvalidDataException.cs
- WindowsScrollBar.cs
- ColumnMapCopier.cs
- RoutedEventHandlerInfo.cs
- SvcMapFileLoader.cs
- RequestBringIntoViewEventArgs.cs
- RepeatInfo.cs
- AudioFormatConverter.cs
- EventMappingSettings.cs
- IdnMapping.cs
- TabControl.cs
- HeaderedItemsControl.cs
- TransactionProtocol.cs
- SimpleRecyclingCache.cs
- WebPartDisplayModeCollection.cs
- Debug.cs
- DrawingVisual.cs
- SqlNodeTypeOperators.cs
- WebAdminConfigurationHelper.cs
- JoinTreeNode.cs
- ConfigurationLocationCollection.cs
- TextTreeInsertElementUndoUnit.cs
- FactoryMaker.cs