Partager via


SocketException Constructeurs

Définition

Initialise une nouvelle instance de la classe SocketException.

Surcharges

Nom Description
SocketException()

Initialise une nouvelle instance de la SocketException classe avec le dernier code d’erreur du système d’exploitation.

SocketException(Int32)

Initialise une nouvelle instance de la SocketException classe avec le code d’erreur spécifié.

SocketException(Int32, String)

Initialise une nouvelle instance de la SocketException classe avec le code d’erreur et le message spécifiés.

SocketException(SerializationInfo, StreamingContext)
Obsolète.

Initialise une nouvelle instance de la SocketException classe à partir des instances spécifiées des classes et StreamingContext des SerializationInfo classes.

SocketException()

Source:
SocketException.Unix.cs
Source:
SocketException.Unix.cs
Source:
SocketException.Unix.cs
Source:
SocketException.Unix.cs
Source:
SocketException.Unix.cs

Initialise une nouvelle instance de la SocketException classe avec le dernier code d’erreur du système d’exploitation.

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

Remarques

Le SocketException constructeur définit la ErrorCode propriété sur la dernière erreur de socket du système d’exploitation qui s’est produite. Pour plus d’informations sur les codes d’erreur de socket, consultez la documentation du code d’erreur de l’API Windows Sockets version 2 .

S’applique à

SocketException(Int32)

Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs

Initialise une nouvelle instance de la SocketException classe avec le code d’erreur spécifié.

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

Paramètres

errorCode
Int32

Code d’erreur qui indique l’erreur qui s’est produite.

Remarques

Le SocketException constructeur définit la ErrorCode propriété sur errorCode.

S’applique à

SocketException(Int32, String)

Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs

Initialise une nouvelle instance de la SocketException classe avec le code d’erreur et le message spécifiés.

public:
 SocketException(int errorCode, System::String ^ message);
public SocketException(int errorCode, string? message);
new System.Net.Sockets.SocketException : int * string -> System.Net.Sockets.SocketException
Public Sub New (errorCode As Integer, message As String)

Paramètres

errorCode
Int32

Code d’erreur qui indique l’erreur qui s’est produite.

message
String

Message décrivant l’erreur.

S’applique à

SocketException(SerializationInfo, StreamingContext)

Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs
Source:
SocketException.cs

Attention

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initialise une nouvelle instance de la SocketException classe à partir des instances spécifiées des classes et StreamingContext des SerializationInfo classes.

protected:
 SocketException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected SocketException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
protected SocketException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.Sockets.SocketException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.Sockets.SocketException
new System.Net.Sockets.SocketException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.Sockets.SocketException
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

Paramètres

serializationInfo
SerializationInfo

Instance SerializationInfo qui contient les informations requises pour sérialiser la nouvelle SocketException instance.

streamingContext
StreamingContext

Qui StreamingContext contient la source du flux sérialisé associé à la nouvelle SocketException instance.

Attributs

Remarques

Ce constructeur implémente l’interface ISerializable pour la SocketException classe.

Voir aussi

S’applique à