Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / ListenerConfig.cs / 1 / ListenerConfig.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Activation { using System.Collections.Generic; using System.Security.Principal; using System.Configuration; using System.Diagnostics; using System.ServiceModel.Diagnostics; using System.ServiceModel.Activation.Configuration; static class ListenerConfig { static object syncRoot = new object(); static NetTcpSectionData tcpData = null; static NetPipeSectionData pipeData = null; static bool diagnosticsSectionInited = false; static bool perfCountersEnabled = false; static object SyncRoot { get { return syncRoot; } } static void EnsureInitializedForDiagnostics() { if (!diagnosticsSectionInited) { lock (SyncRoot) { if (!diagnosticsSectionInited) { DiagnosticSection diag = DiagnosticSection.GetSection(); perfCountersEnabled = diag.PerformanceCountersEnabled; diagnosticsSectionInited = true; } } } } public static void EnsureInitializedForNetTcp() { EnsureInitializedForDiagnostics(); if (tcpData == null) { lock (SyncRoot) { if (tcpData == null) { tcpData = new NetTcpSectionData(); } } } if (DiagnosticUtility.ShouldTraceInformation) { DiagnosticUtility.DiagnosticTrace.TraceEvent(TraceEventType.Information, TraceCode.ReadNetTcpConfig, SR.GetString(SR.TraceCodeReadNetTcpConfig, tcpData.ListenBacklog, tcpData.MaxPendingConnections, tcpData.MaxPendingAccepts, tcpData.ReceiveTimeout, tcpData.TeredoEnabled)); } } public static void EnsureInitializedForNetPipe() { EnsureInitializedForDiagnostics(); if (pipeData == null) { lock (SyncRoot) { if (pipeData == null) { pipeData = new NetPipeSectionData(); } } } if (DiagnosticUtility.ShouldTraceInformation) { DiagnosticUtility.DiagnosticTrace.TraceEvent(TraceEventType.Information, TraceCode.ReadNetPipeConfig, SR.GetString(SR.TraceCodeReadNetPipeConfig, pipeData.MaxPendingConnections, pipeData.MaxPendingAccepts, pipeData.ReceiveTimeout)); } } public static NetTcpSectionData NetTcp { get { EnsureInitializedForNetTcp(); return tcpData; } } public static NetPipeSectionData NetPipe { get { EnsureInitializedForNetPipe(); return pipeData; } } public static bool PerformanceCountersEnabled { get { EnsureInitializedForDiagnostics(); return perfCountersEnabled; } } public static ListGetAllowAccounts(TransportType transportType) { if (transportType == TransportType.Tcp) { if (NetTcp.AllowAccounts.Count == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR.GetString(SR.ConfigSectionHasZeroAllowAccounts, "NetTcpSection"))); } return NetTcp.AllowAccounts; } else if (transportType == TransportType.NamedPipe) { if (NetPipe.AllowAccounts.Count == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR.GetString(SR.ConfigSectionHasZeroAllowAccounts, "NetPipeSection"))); } return NetPipe.AllowAccounts; } return null; } } } // 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
- OleDbTransaction.cs
- StorageEntityContainerMapping.cs
- TdsValueSetter.cs
- ContextBase.cs
- _TimerThread.cs
- ProtectedProviderSettings.cs
- shaperfactoryquerycacheentry.cs
- SocketException.cs
- ArrayItemReference.cs
- MobileControlsSectionHandler.cs
- SqlRemoveConstantOrderBy.cs
- EventRoute.cs
- ProxySimple.cs
- DispatchWrapper.cs
- NavigationExpr.cs
- BinaryReader.cs
- FileIOPermission.cs
- HandlerBase.cs
- XmlTextEncoder.cs
- DataGridViewAdvancedBorderStyle.cs
- SafeSecurityHelper.cs
- PeerEndPoint.cs
- ClientViaElement.cs
- ArglessEventHandlerProxy.cs
- SimpleBitVector32.cs
- ConnectorSelectionGlyph.cs
- WindowProviderWrapper.cs
- DescriptionAttribute.cs
- ActivityExecutorSurrogate.cs
- TimeManager.cs
- SocketPermission.cs
- X509Certificate.cs
- UInt64Converter.cs
- WindowsMenu.cs
- TrustManagerPromptUI.cs
- EncoderFallback.cs
- WizardDesigner.cs
- Peer.cs
- HttpConfigurationContext.cs
- SecurityResources.cs
- AuthorizationSection.cs
- DSASignatureFormatter.cs
- InkCanvasAutomationPeer.cs
- Size3DConverter.cs
- HtmlTableCellCollection.cs
- GridView.cs
- InfoCardRSACryptoProvider.cs
- XmlSchemaAppInfo.cs
- NonParentingControl.cs
- _IPv4Address.cs
- GridLength.cs
- WebSysDescriptionAttribute.cs
- GridItemPattern.cs
- Errors.cs
- TextContainerHelper.cs
- ReflectionHelper.cs
- RuleSettingsCollection.cs
- OdbcConnectionString.cs
- ManipulationCompletedEventArgs.cs
- ParentUndoUnit.cs
- returneventsaver.cs
- SafeProcessHandle.cs
- OleServicesContext.cs
- DataChangedEventManager.cs
- SendMailErrorEventArgs.cs
- CodeGeneratorOptions.cs
- LayoutEditorPart.cs
- IdentifierCollection.cs
- LinqDataSource.cs
- RuntimeEnvironment.cs
- ProfileBuildProvider.cs
- DnsPermission.cs
- MailDefinitionBodyFileNameEditor.cs
- PlanCompilerUtil.cs
- ResourceCategoryAttribute.cs
- XmlWriterSettings.cs
- CurrentTimeZone.cs
- PanelStyle.cs
- pingexception.cs
- TemplateContainer.cs
- RegistryConfigurationProvider.cs
- TextBoxAutomationPeer.cs
- AddInBase.cs
- OdbcParameterCollection.cs
- ObjectDataSourceSelectingEventArgs.cs
- DataObjectSettingDataEventArgs.cs
- ExpressionVisitor.cs
- GeneralTransform3DGroup.cs
- ServiceInfo.cs
- MaskInputRejectedEventArgs.cs
- SQLBinaryStorage.cs
- SessionStateItemCollection.cs
- ProcessModuleCollection.cs
- OleDbReferenceCollection.cs
- RepeaterItem.cs
- RoutedEvent.cs
- AdCreatedEventArgs.cs
- SkipQueryOptionExpression.cs
- Helper.cs
- PromptEventArgs.cs