SocketInformation.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 / SocketInformation.cs / 1 / SocketInformation.cs

                            namespace System.Net.Sockets { 

    [Serializable]
    public struct SocketInformation{
        byte[] protocolInformation; 
        SocketInformationOptions options;
 
        public byte[] ProtocolInformation{ 
            get{
               return protocolInformation; 
            }
            set{
                protocolInformation = value;
            } 
        }
 
 
        public SocketInformationOptions Options{
            get{ 
               return options;
            }
            set{
                options = value; 
            }
        } 
 
        internal bool IsNonBlocking{
            get{ 
               return ((options&SocketInformationOptions.NonBlocking)!=0);
            }
            set{
                if(value){ 
                    options |= SocketInformationOptions.NonBlocking;
                } 
                else{ 
                    options &= ~SocketInformationOptions.NonBlocking;
                } 
            }
        }

        internal bool IsConnected{ 
            get{
                return ((options&SocketInformationOptions.Connected)!=0); 
            } 
            set{
                if(value){ 
                    options |= SocketInformationOptions.Connected;
                }
                else{
                    options &= ~SocketInformationOptions.Connected; 
                }
            } 
        } 

        internal bool IsListening{ 
            get{
                return ((options&SocketInformationOptions.Listening)!=0);
            }
            set{ 
                if(value){
                    options |= SocketInformationOptions.Listening; 
                } 
                else{
                    options &= ~SocketInformationOptions.Listening; 
                }
            }
        }
 
        internal bool UseOnlyOverlappedIO{
            get{ 
                return ((options&SocketInformationOptions.UseOnlyOverlappedIO)!=0); 
            }
            set{ 
                if(value){
                    options |= SocketInformationOptions.UseOnlyOverlappedIO;
                }
                else{ 
                    options &= ~SocketInformationOptions.UseOnlyOverlappedIO;
                } 
            } 
        }
    } 
}


                        

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