NetTcpSectionData.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 / SMSvcHost / System / ServiceModel / Activation / NetTcpSectionData.cs / 1 / NetTcpSectionData.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;

    class NetTcpSectionData 
    {
        int listenBacklog; 
        int maxPendingConnections; 
        int maxPendingAccepts;
        TimeSpan receiveTimeout; 
        bool teredoEnabled;
        List allowAccounts;

        public NetTcpSectionData() 
        {
            NetTcpSection section = (NetTcpSection)ConfigurationManager.GetSection(ConfigurationStrings.NetTcpSectionPath); 
            if (section == null) 
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException()); 
            }

            this.listenBacklog = section.ListenBacklog;
            this.maxPendingConnections = section.MaxPendingConnections; 
            this.maxPendingAccepts = section.MaxPendingAccepts;
            this.receiveTimeout = section.ReceiveTimeout; 
            this.teredoEnabled = section.TeredoEnabled; 
            this.allowAccounts = new List();
            foreach (SecurityIdentifierElement element in section.AllowAccounts) 
            {
                this.allowAccounts.Add(element.SecurityIdentifier);
            }
        } 

        public int ListenBacklog 
        { 
            get
            { 
                return this.listenBacklog;
            }
        }
 
        public int MaxPendingConnections
        { 
            get 
            {
                return this.maxPendingConnections; 
            }
        }

        public int MaxPendingAccepts 
        {
            get 
            { 
                return this.maxPendingAccepts;
            } 
        }
        public TimeSpan ReceiveTimeout
        {
            get 
            {
                return this.receiveTimeout; 
            } 
        }
 
        public bool TeredoEnabled
        {
            get
            { 
                return this.teredoEnabled;
            } 
        } 

        public List AllowAccounts 
        {
            get
            {
                return this.allowAccounts; 
            }
        } 
    } 
}

// 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