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
- ShimAsPublicXamlType.cs
- ExpandoClass.cs
- DependencyPropertyHelper.cs
- RawStylusInputCustomDataList.cs
- PeerNearMe.cs
- SmtpFailedRecipientsException.cs
- input.cs
- ToolStripStatusLabel.cs
- VisualStyleElement.cs
- TextFormatterContext.cs
- EntityDataSourceMemberPath.cs
- ADConnectionHelper.cs
- HttpWriter.cs
- FacetEnabledSchemaElement.cs
- EntityDataSourceMemberPath.cs
- MenuEventArgs.cs
- FrameSecurityDescriptor.cs
- BlurEffect.cs
- Item.cs
- PropertyBuilder.cs
- WhitespaceRule.cs
- SamlAuthenticationClaimResource.cs
- HttpPostProtocolImporter.cs
- AncestorChangedEventArgs.cs
- NumberSubstitution.cs
- XmlWriterSettings.cs
- SymLanguageType.cs
- PnrpPermission.cs
- ListItemConverter.cs
- StickyNoteAnnotations.cs
- CodeTypeDelegate.cs
- ContractReference.cs
- CellPartitioner.cs
- UpdateException.cs
- SchemaManager.cs
- SafeCertificateContext.cs
- CodeTypeReference.cs
- KeyInfo.cs
- WindowsFormsSectionHandler.cs
- Delay.cs
- ThumbAutomationPeer.cs
- HttpCachePolicy.cs
- XmlQueryContext.cs
- ResourceExpressionEditor.cs
- TimeSpanValidatorAttribute.cs
- TabRenderer.cs
- _ListenerResponseStream.cs
- CodeMemberEvent.cs
- WebAdminConfigurationHelper.cs
- TaskFactory.cs
- ExceptionCollection.cs
- SoapInteropTypes.cs
- ViewStateException.cs
- MulticastIPAddressInformationCollection.cs
- mactripleDES.cs
- FlowDecisionDesigner.xaml.cs
- DesignerActionPanel.cs
- WebPartChrome.cs
- PageHandlerFactory.cs
- TriggerBase.cs
- WindowsFormsHelpers.cs
- MethodSet.cs
- AuthenticatedStream.cs
- DesignerOptionService.cs
- AnimationTimeline.cs
- DependentList.cs
- XmlExtensionFunction.cs
- ChtmlPhoneCallAdapter.cs
- FirstMatchCodeGroup.cs
- CodeTypeMember.cs
- SAPICategories.cs
- BmpBitmapEncoder.cs
- WindowsContainer.cs
- UriSection.cs
- PagePropertiesChangingEventArgs.cs
- SerialReceived.cs
- HostUtils.cs
- SchemaTypeEmitter.cs
- PresentationSource.cs
- Math.cs
- ConnectionAcceptor.cs
- XmlILOptimizerVisitor.cs
- WsatExtendedInformation.cs
- SerializationFieldInfo.cs
- BindableAttribute.cs
- DeclaredTypeValidator.cs
- ProtocolImporter.cs
- ProcessActivityTreeOptions.cs
- Selector.cs
- LineGeometry.cs
- CodeTryCatchFinallyStatement.cs
- Int32Converter.cs
- TextWriterTraceListener.cs
- HtmlCalendarAdapter.cs
- RoamingStoreFile.cs
- VisualBrush.cs
- DLinqTableProvider.cs
- CodePageEncoding.cs
- ParameterReplacerVisitor.cs
- InputScopeManager.cs