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
- SurrogateDataContract.cs
- GridViewRow.cs
- StorageEntityTypeMapping.cs
- DefaultPropertyAttribute.cs
- GrammarBuilder.cs
- Variable.cs
- CodeMemberEvent.cs
- TableLayoutRowStyleCollection.cs
- ListControlConvertEventArgs.cs
- Permission.cs
- XmlDocumentType.cs
- VisualBasicHelper.cs
- ScrollViewerAutomationPeer.cs
- SQLInt16.cs
- TextAction.cs
- PageCodeDomTreeGenerator.cs
- JsonQNameDataContract.cs
- ContainerFilterService.cs
- RevocationPoint.cs
- DisableDpiAwarenessAttribute.cs
- RepeatButtonAutomationPeer.cs
- CommandTreeTypeHelper.cs
- HostedController.cs
- StorageBasedPackageProperties.cs
- ToolStripContentPanelRenderEventArgs.cs
- MemberAssignmentAnalysis.cs
- ThrowOnMultipleAssignment.cs
- WindowCollection.cs
- PlaceHolder.cs
- StringValueSerializer.cs
- SqlFunctionAttribute.cs
- ColorBlend.cs
- NamedPipeHostedTransportConfiguration.cs
- ZoneLinkButton.cs
- XmlSortKeyAccumulator.cs
- RuleSettingsCollection.cs
- OleDbReferenceCollection.cs
- AncillaryOps.cs
- NestPullup.cs
- CodeActivity.cs
- CollectionContainer.cs
- SQLDecimal.cs
- Parser.cs
- SaveFileDialog.cs
- BrowserCapabilitiesCodeGenerator.cs
- DefaultValueTypeConverter.cs
- ObjectTag.cs
- Convert.cs
- DetailsViewRowCollection.cs
- TrailingSpaceComparer.cs
- SapiRecognizer.cs
- UnitySerializationHolder.cs
- GestureRecognitionResult.cs
- TemplateControl.cs
- FileDialogPermission.cs
- XmlElementCollection.cs
- EventPrivateKey.cs
- ProcessHostMapPath.cs
- ReflectionServiceProvider.cs
- XamlValidatingReader.cs
- OracleString.cs
- AssemblyName.cs
- CompressStream.cs
- OperationCanceledException.cs
- CallbackValidator.cs
- TrackBarRenderer.cs
- WebSysDescriptionAttribute.cs
- XXXOnTypeBuilderInstantiation.cs
- SourceSwitch.cs
- DataServiceQueryContinuation.cs
- Message.cs
- MultiSelectRootGridEntry.cs
- TableParagraph.cs
- TaiwanLunisolarCalendar.cs
- PowerStatus.cs
- DataConnectionHelper.cs
- DefaultBinder.cs
- LinkedResourceCollection.cs
- DataViewSettingCollection.cs
- XmlJsonReader.cs
- LocalValueEnumerator.cs
- VideoDrawing.cs
- CodeDelegateCreateExpression.cs
- EditorPartChrome.cs
- CompositeControl.cs
- TextBlockAutomationPeer.cs
- ConnectionString.cs
- LoadWorkflowByKeyAsyncResult.cs
- ReadOnlyAttribute.cs
- SqlDependency.cs
- FixedPage.cs
- EntityClassGenerator.cs
- AutomationPatternInfo.cs
- RedirectionProxy.cs
- TemplateControlParser.cs
- TextMarkerSource.cs
- SymmetricAlgorithm.cs
- PocoEntityKeyStrategy.cs
- CharAnimationBase.cs
- SByteStorage.cs