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
- InputLanguageManager.cs
- RegexFCD.cs
- TextTreeTextNode.cs
- LongValidator.cs
- ConnectionsZone.cs
- FontResourceCache.cs
- AssemblyCollection.cs
- SecurityDescriptor.cs
- TemplateXamlParser.cs
- MediaCommands.cs
- CodeExpressionCollection.cs
- DataSetViewSchema.cs
- BitConverter.cs
- OdbcHandle.cs
- RootProjectionNode.cs
- FileDialogPermission.cs
- CollectionDataContract.cs
- TypeHelper.cs
- WsiProfilesElementCollection.cs
- AQNBuilder.cs
- XPathDescendantIterator.cs
- CollectionConverter.cs
- StsCommunicationException.cs
- _LocalDataStore.cs
- RegularExpressionValidator.cs
- CacheForPrimitiveTypes.cs
- WebConfigurationManager.cs
- DecoderExceptionFallback.cs
- TabControlAutomationPeer.cs
- WebPartTransformer.cs
- VariableAction.cs
- TextWriterTraceListener.cs
- SynchronizationLockException.cs
- BitmapEditor.cs
- Funcletizer.cs
- SessionEndingEventArgs.cs
- WebBrowserNavigatingEventHandler.cs
- TextServicesPropertyRanges.cs
- DragStartedEventArgs.cs
- CfgRule.cs
- PrintDialogException.cs
- VerificationAttribute.cs
- AppDomainManager.cs
- AddInSegmentDirectoryNotFoundException.cs
- MetadataExporter.cs
- ConnectionStringSettings.cs
- KeyGesture.cs
- DictionaryKeyPropertyAttribute.cs
- RecommendedAsConfigurableAttribute.cs
- ClientBuildManagerCallback.cs
- TextRangeEditTables.cs
- MenuBindingsEditor.cs
- UrlPropertyAttribute.cs
- DateTimeFormatInfo.cs
- DiscoveryDocumentSearchPattern.cs
- RightNameExpirationInfoPair.cs
- TextEditorCopyPaste.cs
- Group.cs
- VirtualStackFrame.cs
- SourceLocationProvider.cs
- TransformGroup.cs
- DrawingAttributes.cs
- TextEffect.cs
- AuthenticateEventArgs.cs
- MailMessage.cs
- PropertyGridEditorPart.cs
- HwndMouseInputProvider.cs
- RevocationPoint.cs
- ReaderWriterLock.cs
- OleDbWrapper.cs
- ImportCatalogPart.cs
- ServiceDefaults.cs
- ConfigXmlComment.cs
- FixedFindEngine.cs
- VariantWrapper.cs
- TraceHandler.cs
- TransportSecurityHelpers.cs
- TabControlCancelEvent.cs
- FixedTextView.cs
- FontResourceCache.cs
- SqlConnectionManager.cs
- PinnedBufferMemoryStream.cs
- Compress.cs
- ReturnValue.cs
- DesignTimeSiteMapProvider.cs
- DynamicDataRoute.cs
- SimpleWorkerRequest.cs
- SqlComparer.cs
- _SslStream.cs
- PanelStyle.cs
- DeferredElementTreeState.cs
- LayoutTable.cs
- ADConnectionHelper.cs
- RequestCacheValidator.cs
- ServicePointManager.cs
- VisualState.cs
- StateChangeEvent.cs
- XmlSerializableReader.cs
- DefaultAssemblyResolver.cs
- HttpServerVarsCollection.cs