LingerOption.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Sockets / LingerOption.cs / 1305376 / LingerOption.cs

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

 
namespace System.Net.Sockets { 
    using System;
 

    /// 
    ///    Contains information for a socket's linger time, the amount of time it will
    ///       remain after closing if data remains to be sent. 
    /// 
    public class LingerOption { 
        bool enabled; 
        int lingerTime;
 
        /// 
        ///    
        ///       Initializes a new instance of the  class.
        ///     
        /// 
        public LingerOption(bool enable, int seconds) { 
            Enabled = enable; 
            LingerTime = seconds;
        } 

        /// 
        ///    
        ///       Enables or disables lingering after 
        ///       close.
        ///     
        ///  
        public bool Enabled {
            get { 
                return enabled;
            }
            set {
                enabled = value; 
            }
        } 
 
        /// 
        ///     
        ///       The amount of time, in seconds, to remain connected after a close.
        ///    
        /// 
        public int LingerTime { 
            get {
                return lingerTime; 
            } 
            set {
                lingerTime = value; 
            }
        }

    } // class LingerOption 
} // namespace System.Net.Sockets

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

 
namespace System.Net.Sockets { 
    using System;
 

    /// 
    ///    Contains information for a socket's linger time, the amount of time it will
    ///       remain after closing if data remains to be sent. 
    /// 
    public class LingerOption { 
        bool enabled; 
        int lingerTime;
 
        /// 
        ///    
        ///       Initializes a new instance of the  class.
        ///     
        /// 
        public LingerOption(bool enable, int seconds) { 
            Enabled = enable; 
            LingerTime = seconds;
        } 

        /// 
        ///    
        ///       Enables or disables lingering after 
        ///       close.
        ///     
        ///  
        public bool Enabled {
            get { 
                return enabled;
            }
            set {
                enabled = value; 
            }
        } 
 
        /// 
        ///     
        ///       The amount of time, in seconds, to remain connected after a close.
        ///    
        /// 
        public int LingerTime { 
            get {
                return lingerTime; 
            } 
            set {
                lingerTime = value; 
            }
        }

    } // class LingerOption 
} // namespace System.Net.Sockets

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

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