SocketException SocketException SocketException SocketException Constructors

定义

重载

SocketException() SocketException() SocketException()

用最后一个操作系统错误代码初始化 SocketException 类的新实例。Initializes a new instance of the SocketException class with the last operating system error code.

SocketException(Int32) SocketException(Int32) SocketException(Int32) SocketException(Int32)

用指定的错误代码初始化 SocketException 类的新实例。Initializes a new instance of the SocketException class with the specified error code.

SocketException(SerializationInfo, StreamingContext) SocketException(SerializationInfo, StreamingContext) SocketException(SerializationInfo, StreamingContext)

SocketExceptionSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。Initializes a new instance of the SocketException class from the specified instances of the SerializationInfo and StreamingContext classes.

SocketException() SocketException() SocketException()

用最后一个操作系统错误代码初始化 SocketException 类的新实例。Initializes a new instance of the SocketException class with the last operating system error code.

public:
 SocketException();
public SocketException ();
Public Sub New ()

注解

SocketException构造函数ErrorCode将属性设置为上次发生的操作系统套接字错误。The SocketException constructor sets the ErrorCode property to the last operating system socket error that occurred. 有关套接字错误代码的详细信息, 请参阅Windows 套接字版本 2 API 错误代码文档。For more information about socket error codes, see the Windows Sockets version 2 API error code documentation.

SocketException(Int32) SocketException(Int32) SocketException(Int32) SocketException(Int32)

用指定的错误代码初始化 SocketException 类的新实例。Initializes a new instance of the SocketException class with the specified error code.

public:
 SocketException(int errorCode);
public SocketException (int errorCode);
new System.Net.Sockets.SocketException : int -> System.Net.Sockets.SocketException
Public Sub New (errorCode As Integer)

参数

errorCode
Int32 Int32 Int32 Int32

指示发生的错误的错误代码。The error code that indicates the error that occurred.

注解

构造函数将属性设置为errorCodeErrorCode SocketExceptionThe SocketException constructor sets the ErrorCode property to errorCode.

SocketException(SerializationInfo, StreamingContext) SocketException(SerializationInfo, StreamingContext) SocketException(SerializationInfo, StreamingContext)

SocketExceptionSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。Initializes a new instance of the SocketException class from the specified instances of the SerializationInfo and StreamingContext classes.

protected:
 SocketException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected SocketException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.Sockets.SocketException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.Sockets.SocketException

参数

serializationInfo
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

SerializationInfo 实例,包含序列化新的 SocketException 实例所需的信息。A SerializationInfo instance that contains the information that is required to serialize the new SocketException instance.

streamingContext
StreamingContext StreamingContext StreamingContext StreamingContext

StreamingContext,包含与新的 SocketException 实例关联的序列化流的源。A StreamingContext that contains the source of the serialized stream that is associated with the new SocketException instance.

注解

此构造函数实现ISerializable SocketException类的接口。This constructor implements the ISerializable interface for the SocketException class.

另请参阅

适用于