Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / System.ServiceModel.Activation / System / ServiceModel / Activation / HostedTcpTransportManager.cs / 1305376 / HostedTcpTransportManager.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Activation { using System.ServiceModel.Channels; using System.Collections.Generic; using System.Diagnostics; class HostedTcpTransportManager : SharedTcpTransportManager { bool settingsApplied; ActiononViaCallback; public HostedTcpTransportManager(BaseUriWithWildcard baseAddress) : base(baseAddress.BaseAddress) { this.HostNameComparisonMode = baseAddress.HostNameComparisonMode; this.onViaCallback = new Action (OnVia); } internal void Start(int queueId, Guid token, Action messageReceivedCallback) { SetMessageReceivedCallback(messageReceivedCallback); OnOpenInternal(queueId, token); } internal override void OnOpen() { // This is intentionally empty. } internal override void OnClose(TimeSpan timeout) { // This is intentionally empty. } internal override void OnAbort() { // This is intentionally empty. } internal void Stop(TimeSpan timeout) { CleanUp(false, timeout); settingsApplied = false; } protected override Action GetOnViaCallback() { return this.onViaCallback; } void OnVia(Uri address) { Debug.Print("HostedTcpTransportManager.OnVia() address: " + address + " calling EnsureServiceAvailable()"); ServiceHostingEnvironment.EnsureServiceAvailable(address.LocalPath); } protected override void OnSelecting(TcpChannelListener channelListener) { if (settingsApplied) { return; } lock (ThisLock) { if (settingsApplied) { // Use the first one. return; } this.ApplyListenerSettings(channelListener); settingsApplied = true; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Activation { using System.ServiceModel.Channels; using System.Collections.Generic; using System.Diagnostics; class HostedTcpTransportManager : SharedTcpTransportManager { bool settingsApplied; Action onViaCallback; public HostedTcpTransportManager(BaseUriWithWildcard baseAddress) : base(baseAddress.BaseAddress) { this.HostNameComparisonMode = baseAddress.HostNameComparisonMode; this.onViaCallback = new Action (OnVia); } internal void Start(int queueId, Guid token, Action messageReceivedCallback) { SetMessageReceivedCallback(messageReceivedCallback); OnOpenInternal(queueId, token); } internal override void OnOpen() { // This is intentionally empty. } internal override void OnClose(TimeSpan timeout) { // This is intentionally empty. } internal override void OnAbort() { // This is intentionally empty. } internal void Stop(TimeSpan timeout) { CleanUp(false, timeout); settingsApplied = false; } protected override Action GetOnViaCallback() { return this.onViaCallback; } void OnVia(Uri address) { Debug.Print("HostedTcpTransportManager.OnVia() address: " + address + " calling EnsureServiceAvailable()"); ServiceHostingEnvironment.EnsureServiceAvailable(address.LocalPath); } protected override void OnSelecting(TcpChannelListener channelListener) { if (settingsApplied) { return; } lock (ThisLock) { if (settingsApplied) { // Use the first one. return; } this.ApplyListenerSettings(channelListener); settingsApplied = true; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Rotation3D.cs
- InternalsVisibleToAttribute.cs
- XmlCompatibilityReader.cs
- SwitchLevelAttribute.cs
- GridViewItemAutomationPeer.cs
- NativeRightsManagementAPIsStructures.cs
- TypeDelegator.cs
- CompensatableSequenceActivity.cs
- ExpressionPrefixAttribute.cs
- SqlVisitor.cs
- TemplateControl.cs
- TraceListener.cs
- OleServicesContext.cs
- DefaultSettingsSection.cs
- TypeDependencyAttribute.cs
- HtmlTableRow.cs
- IncomingWebResponseContext.cs
- DiagnosticsConfigurationHandler.cs
- ControlPaint.cs
- ShowExpandedMultiValueConverter.cs
- processwaithandle.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- PropertyChangedEventArgs.cs
- ControlIdConverter.cs
- SystemResources.cs
- RemotingServices.cs
- TabControlEvent.cs
- DbParameterCollection.cs
- MemberPathMap.cs
- selecteditemcollection.cs
- CancellationHandler.cs
- CryptoApi.cs
- EntityDataSource.cs
- ServicePointManagerElement.cs
- WindowsProgressbar.cs
- ComNativeDescriptor.cs
- ping.cs
- PathFigureCollectionConverter.cs
- ClientTargetSection.cs
- SoapObjectReader.cs
- Predicate.cs
- ZipPackagePart.cs
- DetailsView.cs
- WorkflowMarkupElementEventArgs.cs
- DataComponentMethodGenerator.cs
- DrawingAttributeSerializer.cs
- X509CertificateValidator.cs
- TextRangeProviderWrapper.cs
- XmlSchemaObjectTable.cs
- TextDecorationCollectionConverter.cs
- EventLogTraceListener.cs
- ObjectDataSource.cs
- NotificationContext.cs
- ThumbAutomationPeer.cs
- ObjectToIdCache.cs
- IIS7UserPrincipal.cs
- MemoryStream.cs
- InternalDuplexBindingElement.cs
- securitycriticaldata.cs
- DragCompletedEventArgs.cs
- TextProperties.cs
- While.cs
- ContentDefinition.cs
- PolicyException.cs
- GlyphShapingProperties.cs
- OutOfProcStateClientManager.cs
- WebServiceMethodData.cs
- GroupBox.cs
- KoreanLunisolarCalendar.cs
- LocalBuilder.cs
- CodeAccessSecurityEngine.cs
- FilteredReadOnlyMetadataCollection.cs
- CryptoKeySecurity.cs
- XmlComplianceUtil.cs
- AdPostCacheSubstitution.cs
- WmiEventSink.cs
- XsltContext.cs
- tibetanshape.cs
- DocumentPageView.cs
- XmlReaderSettings.cs
- MulticastDelegate.cs
- HashHelper.cs
- XMLSyntaxException.cs
- HtmlButton.cs
- NamespaceInfo.cs
- StringDictionaryCodeDomSerializer.cs
- NavigationWindowAutomationPeer.cs
- DataGridViewCellLinkedList.cs
- EncryptedReference.cs
- MasterPage.cs
- ByteBufferPool.cs
- DesignerActionPanel.cs
- RowUpdatingEventArgs.cs
- BaseProcessor.cs
- AnimationClockResource.cs
- DocumentPage.cs
- CompositeActivityValidator.cs
- TextUtf8RawTextWriter.cs
- DbBuffer.cs
- DataGridViewCheckBoxColumn.cs