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
- _FtpDataStream.cs
- Repeater.cs
- CodeTypeOfExpression.cs
- TextServicesCompartmentContext.cs
- StsCommunicationException.cs
- ChannelSinkStacks.cs
- ObservableDictionary.cs
- ReadOnlyNameValueCollection.cs
- FactoryId.cs
- InvalidPrinterException.cs
- Rectangle.cs
- ExpressionConverter.cs
- WizardForm.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ParenthesizePropertyNameAttribute.cs
- DynamicPropertyReader.cs
- ModifierKeysValueSerializer.cs
- KeyManager.cs
- FacetDescription.cs
- GraphicsContainer.cs
- SigningProgress.cs
- FixedTextContainer.cs
- SystemWebExtensionsSectionGroup.cs
- TemplateAction.cs
- HtmlTextArea.cs
- MergablePropertyAttribute.cs
- InstanceDataCollection.cs
- DataGridViewRowHeaderCell.cs
- ExpressionsCollectionConverter.cs
- TransformCollection.cs
- HandledEventArgs.cs
- GZipDecoder.cs
- SizeValueSerializer.cs
- SQLDateTime.cs
- TreeChangeInfo.cs
- RoleManagerSection.cs
- Tracking.cs
- SQLString.cs
- Byte.cs
- DocumentXmlWriter.cs
- EdmConstants.cs
- SiteMapNode.cs
- SuppressMergeCheckAttribute.cs
- PriorityQueue.cs
- WorkflowInstanceTerminatedRecord.cs
- SqlCachedBuffer.cs
- LogicalChannel.cs
- ValidationUtility.cs
- SkewTransform.cs
- DrawingAttributesDefaultValueFactory.cs
- TypeConverterHelper.cs
- ListParagraph.cs
- SqlDataSourceQueryConverter.cs
- BreakRecordTable.cs
- ManagedFilter.cs
- HGlobalSafeHandle.cs
- ContainerUIElement3D.cs
- ReturnValue.cs
- TabControl.cs
- ListViewUpdatedEventArgs.cs
- EventRouteFactory.cs
- SqlClientMetaDataCollectionNames.cs
- GeneralTransform3D.cs
- CreateParams.cs
- SiteMapNodeItemEventArgs.cs
- ThreadSafeList.cs
- SubpageParagraph.cs
- ViewSimplifier.cs
- EntityRecordInfo.cs
- BuildResultCache.cs
- TriState.cs
- FieldToken.cs
- WebPartTracker.cs
- RectKeyFrameCollection.cs
- DtrList.cs
- AnimationClock.cs
- GlobalProxySelection.cs
- BitmapEffect.cs
- hwndwrapper.cs
- ConfigurationException.cs
- SweepDirectionValidation.cs
- MatrixStack.cs
- PasswordDeriveBytes.cs
- DataBoundControlHelper.cs
- DirectoryNotFoundException.cs
- TypeGeneratedEventArgs.cs
- Evaluator.cs
- ColumnMapCopier.cs
- ThicknessAnimationUsingKeyFrames.cs
- MetadataSerializer.cs
- Rijndael.cs
- XmlWhitespace.cs
- ThemeDirectoryCompiler.cs
- TypedTableGenerator.cs
- XmlSerializerAssemblyAttribute.cs
- SuppressMergeCheckAttribute.cs
- PersistChildrenAttribute.cs
- PrivateFontCollection.cs
- Button.cs
- AccessedThroughPropertyAttribute.cs