SocketInformation.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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;
                } 
            } 
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
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;
                } 
            } 
        }
    } 
}

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