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
- StatusStrip.cs
- SynchronousChannel.cs
- OrderPreservingSpoolingTask.cs
- PaperSize.cs
- DataGridPageChangedEventArgs.cs
- HostingPreferredMapPath.cs
- FontInfo.cs
- ArgumentValue.cs
- CodeParameterDeclarationExpression.cs
- TemplateControlBuildProvider.cs
- TreeViewImageKeyConverter.cs
- TextStore.cs
- TaskbarItemInfo.cs
- FtpWebRequest.cs
- NativeMethodsOther.cs
- DataTable.cs
- Hash.cs
- FaultDesigner.cs
- EntityModelSchemaGenerator.cs
- EncryptedKeyHashIdentifierClause.cs
- SchemaConstraints.cs
- QueryContinueDragEventArgs.cs
- ExtensionsSection.cs
- ToolStripTextBox.cs
- SpanIndex.cs
- SortableBindingList.cs
- SafeTimerHandle.cs
- FtpCachePolicyElement.cs
- Message.cs
- Image.cs
- ToolBar.cs
- AssemblyCollection.cs
- _RequestCacheProtocol.cs
- TransactionBehavior.cs
- assertwrapper.cs
- CharEnumerator.cs
- ChannelSinkStacks.cs
- ProcessInputEventArgs.cs
- SecurityTokenProviderContainer.cs
- CatalogZoneBase.cs
- ModelItemImpl.cs
- ViewManager.cs
- ClientData.cs
- SqlGatherConsumedAliases.cs
- TextPointer.cs
- SessionIDManager.cs
- RectIndependentAnimationStorage.cs
- DirectionalLight.cs
- UnsafeNetInfoNativeMethods.cs
- InputScopeNameConverter.cs
- FigureHelper.cs
- CodeExporter.cs
- AnimationTimeline.cs
- WrapPanel.cs
- CriticalHandle.cs
- ProfileServiceManager.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- WmlPhoneCallAdapter.cs
- ColorConvertedBitmapExtension.cs
- ISessionStateStore.cs
- Int64Converter.cs
- DataObjectMethodAttribute.cs
- StreamAsIStream.cs
- ToolboxComponentsCreatedEventArgs.cs
- WaitHandle.cs
- TdsValueSetter.cs
- metadatamappinghashervisitor.cs
- brushes.cs
- UpdatableGenericsFeature.cs
- _NetworkingPerfCounters.cs
- Glyph.cs
- EntityViewGenerationConstants.cs
- TypedMessageConverter.cs
- ObjectAnimationUsingKeyFrames.cs
- DocumentOrderQuery.cs
- XmlNamedNodeMap.cs
- XmlDataLoader.cs
- XmlRootAttribute.cs
- MimeFormReflector.cs
- BasicHttpMessageSecurityElement.cs
- DoubleCollection.cs
- WindowsPen.cs
- ProcessManager.cs
- SearchForVirtualItemEventArgs.cs
- DesignerProperties.cs
- VectorCollection.cs
- IPipelineRuntime.cs
- DefinitionBase.cs
- JoinTreeNode.cs
- SelectionEditingBehavior.cs
- HtmlInputText.cs
- BitConverter.cs
- NamespaceEmitter.cs
- Update.cs
- ConditionedDesigner.cs
- SqlNodeAnnotations.cs
- SubMenuStyle.cs
- NamedPermissionSet.cs
- MDIClient.cs
- OdbcConnectionFactory.cs