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
- SplitContainerDesigner.cs
- PropertyInformationCollection.cs
- BmpBitmapDecoder.cs
- DataGridCellAutomationPeer.cs
- GridView.cs
- EqualityComparer.cs
- SamlAssertion.cs
- DesignTimeVisibleAttribute.cs
- ContainerParaClient.cs
- XmlSchemaCompilationSettings.cs
- BitmapEffectInput.cs
- ConditionValidator.cs
- SqlNodeAnnotation.cs
- OleDbDataReader.cs
- BuildManagerHost.cs
- DataGridViewRowsRemovedEventArgs.cs
- OleDbInfoMessageEvent.cs
- RightsManagementEncryptedStream.cs
- ToolStripOverflow.cs
- CustomValidator.cs
- GridViewEditEventArgs.cs
- Scene3D.cs
- CodeIdentifiers.cs
- WeakReference.cs
- CodeArrayCreateExpression.cs
- PointUtil.cs
- Point3DAnimationBase.cs
- WindowsIPAddress.cs
- _ProxyRegBlob.cs
- Label.cs
- TransformerInfoCollection.cs
- FlowDocumentScrollViewer.cs
- ShimAsPublicXamlType.cs
- _NetworkingPerfCounters.cs
- XmlSchemaChoice.cs
- ViewLoader.cs
- ReflectionTypeLoadException.cs
- WorkflowEventArgs.cs
- MenuItem.cs
- CharEnumerator.cs
- securitycriticaldataformultiplegetandset.cs
- DSACryptoServiceProvider.cs
- XmlSchemaException.cs
- PagedDataSource.cs
- PeerCollaboration.cs
- DataGridPageChangedEventArgs.cs
- EntityUtil.cs
- MarshalByRefObject.cs
- SessionPageStateSection.cs
- HttpMethodAttribute.cs
- SafeProcessHandle.cs
- ValidationContext.cs
- SubtreeProcessor.cs
- BitmapFrameDecode.cs
- TypeConverterBase.cs
- MD5CryptoServiceProvider.cs
- ToolStripItem.cs
- EntityKey.cs
- WebPartManagerDesigner.cs
- HttpCacheVaryByContentEncodings.cs
- TraceInternal.cs
- FormViewDeletedEventArgs.cs
- FamilyMapCollection.cs
- ExpressionNormalizer.cs
- TextParaClient.cs
- OutputCacheProfile.cs
- ChannelAcceptor.cs
- StrongNamePublicKeyBlob.cs
- EpmContentSerializer.cs
- CfgParser.cs
- ActivityBuilder.cs
- DataGridViewUtilities.cs
- DataGridViewRowCancelEventArgs.cs
- SystemWebCachingSectionGroup.cs
- XmlTextReader.cs
- DecoratedNameAttribute.cs
- NetStream.cs
- XomlCompilerParameters.cs
- followingquery.cs
- EventPrivateKey.cs
- GridViewUpdateEventArgs.cs
- SmiContext.cs
- ReadOnlyCollection.cs
- AxImporter.cs
- CrossSiteScriptingValidation.cs
- XmlSchemaDatatype.cs
- RowType.cs
- CommandValueSerializer.cs
- DataGridHeaderBorder.cs
- ClipboardProcessor.cs
- SessionStateModule.cs
- SyndicationSerializer.cs
- SiteMap.cs
- WpfWebRequestHelper.cs
- DoubleAnimationClockResource.cs
- FileStream.cs
- InstanceKeyNotReadyException.cs
- SerializerDescriptor.cs
- RequestTimeoutManager.cs
- SchemaImporterExtensionElementCollection.cs