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
- SkinIDTypeConverter.cs
- XmlSecureResolver.cs
- XmlSchemaSimpleContentRestriction.cs
- SQLDateTime.cs
- XmlNodeReader.cs
- ScriptingWebServicesSectionGroup.cs
- UserControlBuildProvider.cs
- FixedTextPointer.cs
- SqlCommandSet.cs
- GridPatternIdentifiers.cs
- RawTextInputReport.cs
- SafeMILHandle.cs
- BoundingRectTracker.cs
- AttributeUsageAttribute.cs
- COM2FontConverter.cs
- PropertyGeneratedEventArgs.cs
- NotFiniteNumberException.cs
- HttpAsyncResult.cs
- SchemaNamespaceManager.cs
- SkinBuilder.cs
- ButtonBaseAdapter.cs
- CacheChildrenQuery.cs
- AbsoluteQuery.cs
- JpegBitmapEncoder.cs
- PageWrapper.cs
- SendMailErrorEventArgs.cs
- GradientStopCollection.cs
- XmlAnyElementAttribute.cs
- SoapIgnoreAttribute.cs
- SignerInfo.cs
- DbConnectionInternal.cs
- StateWorkerRequest.cs
- FieldNameLookup.cs
- UriExt.cs
- InvalidWorkflowException.cs
- DbConnectionPoolIdentity.cs
- SystemWebCachingSectionGroup.cs
- ValueType.cs
- Cursor.cs
- MsmqActivation.cs
- List.cs
- BinaryReader.cs
- TransactionScope.cs
- MetabaseServerConfig.cs
- XmlUtilWriter.cs
- CodeArrayIndexerExpression.cs
- MessageTraceRecord.cs
- SqlDuplicator.cs
- ClaimComparer.cs
- DictionarySectionHandler.cs
- HttpApplication.cs
- TransformerConfigurationWizardBase.cs
- ConfigurationSettings.cs
- SrgsDocument.cs
- CryptoHelper.cs
- BamlRecordReader.cs
- TextProviderWrapper.cs
- NullableIntMinMaxAggregationOperator.cs
- HyperLinkStyle.cs
- FontStretches.cs
- FlowLayout.cs
- X509SecurityTokenAuthenticator.cs
- ReferentialConstraint.cs
- Image.cs
- WebEventTraceProvider.cs
- Pen.cs
- StorageMappingFragment.cs
- XmlQueryContext.cs
- Model3DGroup.cs
- XmlElement.cs
- Compress.cs
- PageParserFilter.cs
- Transactions.cs
- PrintPageEvent.cs
- BindingGroup.cs
- Part.cs
- SrgsElement.cs
- HandlerFactoryWrapper.cs
- SourceSwitch.cs
- XPathSelfQuery.cs
- XmlComplianceUtil.cs
- LinkTarget.cs
- _RequestCacheProtocol.cs
- bindurihelper.cs
- _HTTPDateParse.cs
- BrushValueSerializer.cs
- LingerOption.cs
- DataTableReaderListener.cs
- BamlRecordWriter.cs
- EDesignUtil.cs
- PlainXmlSerializer.cs
- BlurEffect.cs
- ClusterSafeNativeMethods.cs
- IssuanceLicense.cs
- ItemCheckedEvent.cs
- PopupControlService.cs
- LoadWorkflowByKeyAsyncResult.cs
- RightsManagementInformation.cs
- Size.cs
- DataServiceRequestOfT.cs