Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / PeerDuplexChannelListener.cs / 1 / PeerDuplexChannelListener.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 PeerDuplexChannelAcceptor : SingletonChannelAcceptor{ PeerNodeImplementation peerNode; PeerNodeImplementation.Registration registration; EndpointAddress localAddress; Uri via; PeerMessageDispatcher dispatcher = null; public PeerDuplexChannelAcceptor(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); this.dispatcher = new PeerMessageDispatcher (queueHandler, peerNode, ChannelManager, localAddress, via); } 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; } } protected override PeerDuplexChannel OnCreateChannel() { return new PeerDuplexChannel(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); } } } sealed class PeerDuplexChannelListener : PeerChannelListener { PeerDuplexChannelAcceptor duplexAcceptor; public PeerDuplexChannelListener(PeerTransportBindingElement bindingElement, BindingContext context, PeerResolver peerResolver) : base(bindingElement, context, peerResolver) { } protected override PeerDuplexChannelAcceptor ChannelAcceptor { get { return this.duplexAcceptor; } } protected override void CreateAcceptor() { this.duplexAcceptor = new PeerDuplexChannelAcceptor(this.InnerNode, this.Registration, this, new EndpointAddress(this.Uri), this.BaseUri); } } } // 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
- GlobalItem.cs
- RichTextBox.cs
- ObjectTokenCategory.cs
- JsonReaderDelegator.cs
- Console.cs
- WebHttpElement.cs
- TextParagraphView.cs
- WebPartDescriptionCollection.cs
- PagedDataSource.cs
- DesignBindingValueUIHandler.cs
- Material.cs
- DataRow.cs
- Compiler.cs
- MarkupExtensionParser.cs
- IdnElement.cs
- Parameter.cs
- CompareValidator.cs
- SchemaCollectionCompiler.cs
- OleDbStruct.cs
- ElementAction.cs
- LicenseContext.cs
- SamlConditions.cs
- TextEffectResolver.cs
- GreaterThan.cs
- DecoderBestFitFallback.cs
- MbpInfo.cs
- WinEventWrap.cs
- XPathNodeHelper.cs
- Parser.cs
- TemplateAction.cs
- TreeViewEvent.cs
- RowToParametersTransformer.cs
- DataConnectionHelper.cs
- SerializationException.cs
- DataObject.cs
- DataViewListener.cs
- WebBrowserProgressChangedEventHandler.cs
- ItemsControl.cs
- Module.cs
- nulltextcontainer.cs
- TimeSpanValidatorAttribute.cs
- FindSimilarActivitiesVerb.cs
- KernelTypeValidation.cs
- NetworkCredential.cs
- ConfigurationSectionGroupCollection.cs
- EtwTrace.cs
- IteratorDescriptor.cs
- Light.cs
- ExceptionUtil.cs
- Helper.cs
- TextElementEnumerator.cs
- IsolatedStorageFilePermission.cs
- UserNameSecurityTokenAuthenticator.cs
- COM2ExtendedUITypeEditor.cs
- FocusChangedEventArgs.cs
- SortedList.cs
- _FtpDataStream.cs
- SmtpDigestAuthenticationModule.cs
- IndentedWriter.cs
- BaseAddressPrefixFilterElementCollection.cs
- IndexedString.cs
- ComplexObject.cs
- XsdBuildProvider.cs
- XmlAnyAttributeAttribute.cs
- ImpersonationContext.cs
- SchemaMapping.cs
- TypeBuilderInstantiation.cs
- TextDpi.cs
- RequestNavigateEventArgs.cs
- DataGridCommandEventArgs.cs
- EncryptedHeaderXml.cs
- ContainerParaClient.cs
- RuleConditionDialog.Designer.cs
- Expression.cs
- CharacterMetrics.cs
- wgx_sdk_version.cs
- RenderingEventArgs.cs
- CancellationState.cs
- VoiceInfo.cs
- LineBreakRecord.cs
- SendKeys.cs
- XmlSchemaSimpleContent.cs
- ResourcesGenerator.cs
- TextBlock.cs
- AttachedPropertyMethodSelector.cs
- UriSection.cs
- XmlEntity.cs
- PatternMatcher.cs
- Msec.cs
- SafeTimerHandle.cs
- BitmapFrameDecode.cs
- FormViewInsertEventArgs.cs
- RNGCryptoServiceProvider.cs
- Floater.cs
- Typeface.cs
- XamlPoint3DCollectionSerializer.cs
- InstancePersistenceCommandException.cs
- TickBar.cs
- PrtTicket_Base.cs
- PageTheme.cs