Condividi tramite


SocketError Classe

Definizione

Fornisce lo stato di errore del socket per le operazioni su un oggetto DatagramSocket, StreamSocket o StreamSocketListener.

public ref class SocketError abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SocketError final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class SocketError
Public Class SocketError
Ereditarietà
Object Platform::Object IInspectable SocketError
Attributi

Requisiti Windows

Famiglia di dispositivi
Windows 10 (è stato introdotto in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (è stato introdotto in v1.0)
Funzionalità dell'app
ID_CAP_NETWORKING [Windows Phone]

Commenti

Viene restituito un errore durante l'operazione socket come valore HRESULT . Il metodo GetStatus nell'oggetto SocketError viene utilizzato per convertire un errore da un'operazione socket a un valore di enumerazione SocketErrorStatus . La maggior parte dei valori di enumerazione SocketErrorStatus corrisponde a un errore restituito dall'operazione socket di Windows nativa.

Metodi

GetStatus(Int32)

Ottiene un valore SocketErrorStatus basato su un errore rilevato da un'operazione socket.

Si applica a

Vedi anche