Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / PeerDuplexChannelListener.cs / 1 / PeerDuplexChannelListener.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Collections.Generic; using System.ServiceModel; using System.Diagnostics; using System.Threading; using System.ServiceModel.Diagnostics; sealed class PeerDuplexChannelAcceptor : SingletonChannelAcceptor{ PeerNodeImplementation peerNode; PeerNodeImplementation.Registration registration; EndpointAddress localAddress; Uri via; PeerMessageDispatcher dispatcher = null; public PeerDuplexChannelAcceptor(PeerNodeImplementation peerNode, PeerNodeImplementation.Registration registration, ChannelManagerBase channelManager, EndpointAddress localAddress, Uri via) : base(channelManager) { this.registration = registration; this.peerNode = peerNode; this.localAddress = localAddress; this.via = via; PeerMessageDispatcher .PeerMessageQueueAdapter queueHandler = new PeerMessageDispatcher .PeerMessageQueueAdapter(this); this.dispatcher = new PeerMessageDispatcher (queueHandler, peerNode, ChannelManager, localAddress, via); } protected override void OnClose(TimeSpan timeout) { } protected override void OnClosing() { CloseDispatcher(); base.OnClosing(); } protected override void OnFaulted() { CloseDispatcher(); base.OnFaulted(); } void CloseDispatcher() { if(dispatcher != null) { dispatcher.Unregister(true); dispatcher = null; } } protected override PeerDuplexChannel OnCreateChannel() { return new PeerDuplexChannel(peerNode, registration, ChannelManager, localAddress, via); } protected override void OnTraceMessageReceived(Message message) { if (DiagnosticUtility.ShouldTraceInformation) { TraceUtility.TraceEvent(TraceEventType.Information, TraceCode.MessageReceived, MessageTransmitTraceRecord.CreateReceiveTraceRecord(message), this, null); } } } sealed class PeerDuplexChannelListener : PeerChannelListener { PeerDuplexChannelAcceptor duplexAcceptor; public PeerDuplexChannelListener(PeerTransportBindingElement bindingElement, BindingContext context, PeerResolver peerResolver) : base(bindingElement, context, peerResolver) { } protected override PeerDuplexChannelAcceptor ChannelAcceptor { get { return this.duplexAcceptor; } } protected override void CreateAcceptor() { this.duplexAcceptor = new PeerDuplexChannelAcceptor(this.InnerNode, this.Registration, this, new EndpointAddress(this.Uri), this.BaseUri); } } } // 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
- AddDataControlFieldDialog.cs
- RadioButtonAutomationPeer.cs
- DiagnosticTraceSource.cs
- SafeFindHandle.cs
- Latin1Encoding.cs
- ExclusiveCanonicalizationTransform.cs
- HashCryptoHandle.cs
- LightweightCodeGenerator.cs
- WindowClosedEventArgs.cs
- ProcessModuleCollection.cs
- _SslState.cs
- SoapSchemaExporter.cs
- StringFunctions.cs
- DataColumnMapping.cs
- DataViewSetting.cs
- LogAppendAsyncResult.cs
- ActiveXContainer.cs
- TransactionFlowProperty.cs
- SlipBehavior.cs
- JournalEntry.cs
- LogFlushAsyncResult.cs
- PointKeyFrameCollection.cs
- DataGridViewToolTip.cs
- coordinatorfactory.cs
- SchemaElement.cs
- RegistryDataKey.cs
- HtmlTableCell.cs
- WindowsFormsHostAutomationPeer.cs
- ComPlusTypeLoader.cs
- XmlSchemaAny.cs
- Token.cs
- CustomWebEventKey.cs
- SubpageParagraph.cs
- PermissionSet.cs
- PageAdapter.cs
- odbcmetadatacollectionnames.cs
- GeneratedContractType.cs
- CodeDirectoryCompiler.cs
- SiteMapProvider.cs
- Grid.cs
- CodeTypeOfExpression.cs
- COAUTHINFO.cs
- GridViewColumnHeaderAutomationPeer.cs
- GridViewColumnHeaderAutomationPeer.cs
- SqlCachedBuffer.cs
- Util.cs
- EarlyBoundInfo.cs
- Walker.cs
- ApplicationBuildProvider.cs
- UndirectedGraph.cs
- NavigatorOutput.cs
- StorageInfo.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- PerformanceCounterPermissionAttribute.cs
- ProtocolsConfigurationHandler.cs
- ObsoleteAttribute.cs
- Win32Exception.cs
- CodeTypeReferenceExpression.cs
- Fonts.cs
- autovalidator.cs
- TimeManager.cs
- EmptyEnumerator.cs
- TextEditorMouse.cs
- ProtectedConfiguration.cs
- ReceiveActivityValidator.cs
- ForwardPositionQuery.cs
- ListViewInsertedEventArgs.cs
- UIElementParaClient.cs
- GridViewCancelEditEventArgs.cs
- HwndProxyElementProvider.cs
- DeferredElementTreeState.cs
- ToolStripHighContrastRenderer.cs
- handlecollector.cs
- TreeNodeCollectionEditorDialog.cs
- AmbientLight.cs
- String.cs
- NamespaceInfo.cs
- SQLBinary.cs
- FunctionCommandText.cs
- TargetControlTypeAttribute.cs
- DocComment.cs
- DataControlFieldCell.cs
- CodeTypeMemberCollection.cs
- PreProcessor.cs
- PropertyGridEditorPart.cs
- IIS7UserPrincipal.cs
- HeaderUtility.cs
- MergablePropertyAttribute.cs
- ImageClickEventArgs.cs
- ConfigurationValues.cs
- StructuralObject.cs
- Tokenizer.cs
- SetIndexBinder.cs
- Journal.cs
- XmlSchemaGroup.cs
- MobileTextWriter.cs
- CloudCollection.cs
- TrackingSection.cs
- QilBinary.cs
- XmlSchemaSimpleTypeUnion.cs