LingerOption.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Sockets / LingerOption.cs / 1 / 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


                        

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