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
- ReleaseInstanceMode.cs
- SqlClientMetaDataCollectionNames.cs
- DetailsViewActionList.cs
- XmlWrappingReader.cs
- SqlBuilder.cs
- SQLDateTimeStorage.cs
- TraceSource.cs
- SettingsAttributeDictionary.cs
- XhtmlTextWriter.cs
- ProfileSettingsCollection.cs
- DotAtomReader.cs
- DurableInstancingOptions.cs
- NodeFunctions.cs
- MessageSecurityProtocol.cs
- SkewTransform.cs
- XhtmlBasicSelectionListAdapter.cs
- PageStatePersister.cs
- COM2FontConverter.cs
- GridItemCollection.cs
- AmbiguousMatchException.cs
- ServiceAuthorizationManager.cs
- AutoCompleteStringCollection.cs
- SrgsNameValueTag.cs
- GlobalizationSection.cs
- Console.cs
- StringDictionaryCodeDomSerializer.cs
- FontCacheUtil.cs
- PolyBezierSegment.cs
- SpnegoTokenProvider.cs
- AttributeData.cs
- XmlSchemaComplexContentRestriction.cs
- ReadOnlyNameValueCollection.cs
- XamlToRtfParser.cs
- DirectoryGroupQuery.cs
- HostVisual.cs
- XmlSchemaObject.cs
- RequestUriProcessor.cs
- DecimalAnimation.cs
- QueryExpr.cs
- TextTreeExtractElementUndoUnit.cs
- ArgIterator.cs
- SystemResourceKey.cs
- ToolboxItemCollection.cs
- TextSyndicationContentKindHelper.cs
- StoreItemCollection.Loader.cs
- SoapMessage.cs
- OleDbRowUpdatedEvent.cs
- DodSequenceMerge.cs
- ByteFacetDescriptionElement.cs
- HttpInputStream.cs
- TypeToken.cs
- BaseProcessor.cs
- SaveLedgerEntryRequest.cs
- IntSecurity.cs
- QueryStack.cs
- CompilerGeneratedAttribute.cs
- StylusEventArgs.cs
- DataTableNewRowEvent.cs
- JsonEnumDataContract.cs
- CacheVirtualItemsEvent.cs
- Module.cs
- RegistryExceptionHelper.cs
- SafeLocalMemHandle.cs
- SQlBooleanStorage.cs
- ViewBox.cs
- WindowPattern.cs
- CounterSampleCalculator.cs
- TdsEnums.cs
- TextEditorTyping.cs
- ColumnMapProcessor.cs
- SecurityUtils.cs
- BufferBuilder.cs
- TypeConstant.cs
- RoleManagerEventArgs.cs
- SelectionChangedEventArgs.cs
- RequestQueryParser.cs
- latinshape.cs
- RuleRefElement.cs
- TextRange.cs
- AnnotationResourceCollection.cs
- RadioButton.cs
- PresentationTraceSources.cs
- ToolStripMenuItem.cs
- METAHEADER.cs
- MimeTypePropertyAttribute.cs
- MergeFailedEvent.cs
- StandardCommandToolStripMenuItem.cs
- MailAddress.cs
- OperationSelectorBehavior.cs
- GifBitmapDecoder.cs
- DataProviderNameConverter.cs
- AutomationElementCollection.cs
- BrowserCapabilitiesCodeGenerator.cs
- AlternationConverter.cs
- basecomparevalidator.cs
- WindowPattern.cs
- FontStyle.cs
- StreamGeometryContext.cs
- MenuItemBinding.cs
- SettingsPropertyIsReadOnlyException.cs