System.Net.Sockets.SocketException.SocketException C# (CSharp) Метод

SocketException() публичный Метод

Creates a new instance of the class with the specified error code.
public SocketException ( int errorCode ) : System.ComponentModel
errorCode int
Результат System.ComponentModel
        public SocketException(int errorCode) : this((SocketError)errorCode)
        {
            // NOTE: SocketException(SocketError) isn't exposed publicly.  As a result, code with a SocketError calls
            // this ctor, e.g. 
            //     SocketError error = ...;
            //     throw new SocketException((int)error);
            // That means we need to assume the errorCode is a SocketError value, rather than a platform-specific error code. 
            // Hence, no translation on the supplied code.  This does mean on Unix there's a difference between:
            //     new SocketException(); // will treat the last error as a native error code and translate it appropriately
            // and:
            //     new SocketException(Marshal.GetLastWin32Error()); // will treat the last error as a SocketError, inappropriately
            // but that's the least bad option right now.
        }

Same methods

SocketException::SocketException ( ) : System.ComponentModel
SocketException::SocketException ( Interop error ) : System.ComponentModel
SocketException::SocketException ( SerializationInfo serializationInfo, StreamingContext streamingContext ) : System.ComponentModel
SocketException::SocketException ( SocketError socketError ) : System.ComponentModel
SocketException::SocketException ( SocketError errorCode, uint platformError ) : System.ComponentModel