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
- Int32EqualityComparer.cs
- TypedTableBase.cs
- PrintPreviewGraphics.cs
- TaskFormBase.cs
- ComponentDispatcherThread.cs
- HostSecurityManager.cs
- AddressingVersion.cs
- FileDialogCustomPlacesCollection.cs
- SafeFindHandle.cs
- Animatable.cs
- DataGridViewAdvancedBorderStyle.cs
- ToolStripSettings.cs
- HandlerBase.cs
- TypeExtension.cs
- MatrixAnimationUsingPath.cs
- BindingObserver.cs
- Point3D.cs
- FilteredDataSetHelper.cs
- GraphicsPathIterator.cs
- SHA384Managed.cs
- Error.cs
- CustomAttributeFormatException.cs
- NamespaceEmitter.cs
- TaskExceptionHolder.cs
- FigureHelper.cs
- _UriSyntax.cs
- DetailsViewInsertedEventArgs.cs
- ExecutedRoutedEventArgs.cs
- SoapSchemaExporter.cs
- CredentialCache.cs
- SQLByte.cs
- SqlCacheDependency.cs
- TextServicesDisplayAttribute.cs
- ListView.cs
- MouseGesture.cs
- VectorCollectionValueSerializer.cs
- SamlAuthenticationClaimResource.cs
- ModifiableIteratorCollection.cs
- PageSettings.cs
- PreviewPageInfo.cs
- AdornerHitTestResult.cs
- Terminate.cs
- CSharpCodeProvider.cs
- SafeLocalMemHandle.cs
- SimpleBitVector32.cs
- SqlUdtInfo.cs
- CheckedListBox.cs
- SimpleApplicationHost.cs
- JoinSymbol.cs
- Rect3DValueSerializer.cs
- sqlser.cs
- SubclassTypeValidatorAttribute.cs
- ClientSettingsProvider.cs
- CheckBoxRenderer.cs
- ShadowGlyph.cs
- GridEntry.cs
- JsonUriDataContract.cs
- TreeNodeStyleCollection.cs
- ProxyWebPartManager.cs
- CheckBoxField.cs
- OdbcException.cs
- InkCollectionBehavior.cs
- DeploymentExceptionMapper.cs
- DragEvent.cs
- PageAsyncTask.cs
- VirtualDirectoryMappingCollection.cs
- TextBoxView.cs
- XmlSchemaProviderAttribute.cs
- SqlUtil.cs
- SafeThreadHandle.cs
- ActivationServices.cs
- ToolStripItemCollection.cs
- Switch.cs
- CopyEncoder.cs
- ActiveXHost.cs
- DataGridDesigner.cs
- ConfigUtil.cs
- HierarchicalDataSourceControl.cs
- SmiGettersStream.cs
- NotifyIcon.cs
- SelectionChangedEventArgs.cs
- KoreanLunisolarCalendar.cs
- ButtonBase.cs
- RawStylusInputCustomData.cs
- IIS7WorkerRequest.cs
- GetImportedCardRequest.cs
- Application.cs
- ResolveNameEventArgs.cs
- Block.cs
- DataStorage.cs
- CapacityStreamGeometryContext.cs
- ModelTreeManager.cs
- Bind.cs
- BoundingRectTracker.cs
- TextRunTypographyProperties.cs
- MapPathBasedVirtualPathProvider.cs
- ObjectCloneHelper.cs
- VisualStyleElement.cs
- DisplayNameAttribute.cs
- TextUtf8RawTextWriter.cs