Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / PeerInputChannelListener.cs / 1 / PeerInputChannelListener.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 PeerInputChannelAcceptor : SingletonChannelAcceptor{ PeerNodeImplementation peerNode; PeerNodeImplementation.Registration registration; EndpointAddress localAddress; Uri via; PeerMessageDispatcher dispatcher = null; public PeerInputChannelAcceptor(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); dispatcher = new PeerMessageDispatcher (queueHandler, peerNode, ChannelManager, localAddress, via); } protected override PeerInputChannel OnCreateChannel() { return new PeerInputChannel(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); } } 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; } } } sealed class PeerInputChannelListener : PeerChannelListener { PeerInputChannelAcceptor inputAcceptor; public PeerInputChannelListener(PeerTransportBindingElement bindingElement, BindingContext context, PeerResolver peerResolver) : base(bindingElement, context, peerResolver) { } protected override PeerInputChannelAcceptor ChannelAcceptor { get { return this.inputAcceptor; } } protected override void CreateAcceptor() { this.inputAcceptor = new PeerInputChannelAcceptor(this.InnerNode, this.Registration, this, new EndpointAddress(this.Uri), this.Uri); } } } // 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
- AlgoModule.cs
- QilList.cs
- FormsAuthenticationConfiguration.cs
- OutOfProcStateClientManager.cs
- EventEntry.cs
- MergePropertyDescriptor.cs
- ActivityStateRecord.cs
- TransactionFilter.cs
- Overlapped.cs
- ConfigurationValue.cs
- httpserverutility.cs
- IPCCacheManager.cs
- PeerUnsafeNativeCryptMethods.cs
- SqlAliaser.cs
- TextFindEngine.cs
- SQLInt32Storage.cs
- VirtualPathProvider.cs
- EdmValidator.cs
- ScriptingJsonSerializationSection.cs
- AndCondition.cs
- XsltInput.cs
- TreeNodeClickEventArgs.cs
- XmlNamespaceDeclarationsAttribute.cs
- TypeConverterAttribute.cs
- ExceptionHelpers.cs
- MultiBindingExpression.cs
- CorrelationManager.cs
- HtmlInputRadioButton.cs
- WindowsTitleBar.cs
- Freezable.cs
- DataGridViewColumn.cs
- CodeAccessSecurityEngine.cs
- Slider.cs
- DateTimeValueSerializerContext.cs
- controlskin.cs
- SizeConverter.cs
- ViewPort3D.cs
- CollectionBase.cs
- MappingSource.cs
- EntityUtil.cs
- SQLDoubleStorage.cs
- SpellerStatusTable.cs
- MatrixAnimationUsingKeyFrames.cs
- SystemResourceKey.cs
- WebDescriptionAttribute.cs
- Win32Exception.cs
- XmlSortKey.cs
- MobileSysDescriptionAttribute.cs
- MasterPageCodeDomTreeGenerator.cs
- TemplateBamlRecordReader.cs
- ThrowHelper.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- SerializerProvider.cs
- ArgumentNullException.cs
- TreeNode.cs
- XamlHostingSection.cs
- UriTemplateTrieLocation.cs
- GeometryGroup.cs
- SecurityPermission.cs
- OracleFactory.cs
- Timeline.cs
- UndoUnit.cs
- TcpClientCredentialType.cs
- SqlTrackingWorkflowInstance.cs
- CancellationHandler.cs
- WorkflowTraceTransfer.cs
- SmtpTransport.cs
- TableColumn.cs
- SectionUpdates.cs
- UrlEncodedParameterWriter.cs
- _ProxyChain.cs
- Misc.cs
- LogReserveAndAppendState.cs
- TreeBuilderXamlTranslator.cs
- ToolStripPanel.cs
- BufferModesCollection.cs
- _emptywebproxy.cs
- DynamicILGenerator.cs
- DataStreamFromComStream.cs
- WeakReferenceList.cs
- FlowDecision.cs
- BindingExpressionUncommonField.cs
- StylusOverProperty.cs
- XmlnsDefinitionAttribute.cs
- IOThreadScheduler.cs
- MouseEvent.cs
- TextServicesContext.cs
- TextBoxAutomationPeer.cs
- RadioButton.cs
- ContractSearchPattern.cs
- ContractComponent.cs
- ColumnResizeAdorner.cs
- ObjectPersistData.cs
- OutputCacheEntry.cs
- XPathPatternParser.cs
- FixedSOMPage.cs
- ZipFileInfoCollection.cs
- TextWriter.cs
- RadioButtonBaseAdapter.cs
- DisplayNameAttribute.cs