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
- RegisteredDisposeScript.cs
- DrawingState.cs
- StringInfo.cs
- DoubleStorage.cs
- SubtreeProcessor.cs
- DoubleAnimationUsingKeyFrames.cs
- Literal.cs
- PackagePart.cs
- iisPickupDirectory.cs
- SystemNetHelpers.cs
- BindingExpression.cs
- StyleXamlParser.cs
- UnorderedHashRepartitionStream.cs
- CodeConditionStatement.cs
- DictionaryContent.cs
- EntityConnectionStringBuilder.cs
- StickyNoteAnnotations.cs
- TemplateBindingExpression.cs
- ProcessHostServerConfig.cs
- XmlSchemaChoice.cs
- DbParameterHelper.cs
- PropertyCollection.cs
- AspCompat.cs
- FieldNameLookup.cs
- MenuItemStyleCollection.cs
- MaskedTextBox.cs
- UIElement.cs
- serverconfig.cs
- WasAdminWrapper.cs
- LightweightEntityWrapper.cs
- ElapsedEventArgs.cs
- UpdateExpressionVisitor.cs
- EventLogEntryCollection.cs
- MemoryStream.cs
- Calendar.cs
- FixUpCollection.cs
- Interlocked.cs
- MDIWindowDialog.cs
- TrackBarRenderer.cs
- DataGridCellsPanel.cs
- PrePostDescendentsWalker.cs
- Column.cs
- XmlLoader.cs
- SecureEnvironment.cs
- DynamicUpdateCommand.cs
- WeakReferenceList.cs
- AllMembershipCondition.cs
- PolyLineSegment.cs
- NativeRecognizer.cs
- QEncodedStream.cs
- PageRequestManager.cs
- SqlLiftWhereClauses.cs
- FlowLayoutSettings.cs
- XamlLoadErrorInfo.cs
- BroadcastEventHelper.cs
- ValidatorCompatibilityHelper.cs
- DynamicDocumentPaginator.cs
- MimeMapping.cs
- MemberExpressionHelper.cs
- SuspendDesigner.cs
- BatchParser.cs
- Helper.cs
- SoapProtocolReflector.cs
- ReliableOutputSessionChannel.cs
- X509RawDataKeyIdentifierClause.cs
- BuildProviderUtils.cs
- OracleColumn.cs
- WebReferencesBuildProvider.cs
- XmlnsDictionary.cs
- HttpUnhandledOperationInvoker.cs
- CodeDirectoryCompiler.cs
- SafeNativeMethodsMilCoreApi.cs
- SizeFConverter.cs
- assemblycache.cs
- TableLayoutColumnStyleCollection.cs
- CorrelationManager.cs
- MatrixTransform3D.cs
- SqlFormatter.cs
- UInt32Storage.cs
- HTTPRemotingHandler.cs
- MembershipSection.cs
- IdentifierService.cs
- FontSizeConverter.cs
- GrammarBuilderBase.cs
- DelegateArgument.cs
- ToolStripItemEventArgs.cs
- DashStyles.cs
- GridViewPageEventArgs.cs
- ObjectDataSourceFilteringEventArgs.cs
- HtmlToClrEventProxy.cs
- DispatcherExceptionFilterEventArgs.cs
- EventArgs.cs
- ProjectionPlanCompiler.cs
- InvokeBinder.cs
- JumpPath.cs
- SingleObjectCollection.cs
- WebBrowsableAttribute.cs
- HttpListenerException.cs
- DeploymentSectionCache.cs
- DrawingCollection.cs