NetTcpSection.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Activation / Configuration / NetTcpSection.cs / 1 / NetTcpSection.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.ServiceModel.Activation.Configuration 
{
    using System; 
    using System.Configuration; 
    using System.Collections.Generic;
    using System.Diagnostics; 
    using System.Globalization;
    using System.Net.Sockets;
    using System.Security.Principal;
    using System.ServiceModel.Channels; 

    public sealed partial class NetTcpSection : ConfigurationSection 
    { 
        public NetTcpSection() : base()
        { 
        }

        [ConfigurationProperty(ConfigurationStrings.AllowAccounts)]
        public SecurityIdentifierElementCollection AllowAccounts 
        {
            get { return (SecurityIdentifierElementCollection)base[ConfigurationStrings.AllowAccounts]; } 
        } 

        static internal NetTcpSection GetSection() 
        {
            NetTcpSection retval = (NetTcpSection)ConfigurationManager.GetSection(ConfigurationStrings.NetTcpSectionPath);
            if (retval == null)
            { 
                retval = new NetTcpSection();
            } 
            return retval; 
        }
 
        protected override void InitializeDefault()
        {
            this.AllowAccounts.SetDefaultIdentifiers();
        } 

        [ConfigurationProperty(ConfigurationStrings.ListenBacklog, DefaultValue = ListenerConstants.DefaultListenBackLog)] 
        [IntegerValidator(MinValue = 1)] 
        public int ListenBacklog
        { 
            get { return (int)base[ConfigurationStrings.ListenBacklog]; }
            set { base[ConfigurationStrings.ListenBacklog] = value; }
        }
 
        [ConfigurationProperty(ConfigurationStrings.MaxPendingConnections, DefaultValue = ListenerConstants.DefaultMaxPendingConnections)]
        [IntegerValidator(MinValue = 1)] 
        public int MaxPendingConnections 
        {
            get { return (int)base[ConfigurationStrings.MaxPendingConnections]; } 
            set { base[ConfigurationStrings.MaxPendingConnections] = value; }
        }

        [ConfigurationProperty(ConfigurationStrings.MaxPendingAccepts, DefaultValue = ListenerConstants.DefaultMaxPendingAccepts)] 
        [IntegerValidator(MinValue = 1)]
        public int MaxPendingAccepts 
        { 
            get { return (int)base[ConfigurationStrings.MaxPendingAccepts]; }
            set { base[ConfigurationStrings.MaxPendingAccepts] = value; } 
        }

        [ConfigurationProperty(ConfigurationStrings.ReceiveTimeout, DefaultValue = ListenerConstants.DefaultReceiveTimeoutString)]
        [System.ComponentModel.TypeConverter(typeof(TimeSpanOrInfiniteConverter))] 
        [System.ServiceModel.Configuration.ServiceModelTimeSpanValidator(MinValueString = ConfigurationStrings.TimeSpanZero)]
        public TimeSpan ReceiveTimeout 
        { 
            get { return (TimeSpan)base[ConfigurationStrings.ReceiveTimeout]; }
            set { base[ConfigurationStrings.ReceiveTimeout] = value; } 
        }

        [ConfigurationProperty(ConfigurationStrings.TeredoEnabled, DefaultValue = ListenerConstants.DefaultTeredoEnabled)]
        public bool TeredoEnabled 
        {
            get { return (bool)base[ConfigurationStrings.TeredoEnabled]; } 
            set { base[ConfigurationStrings.TeredoEnabled] = value; } 
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK