Skip to main content

Windows Dev Center

SocketError.GetStatus | getStatus method

Gets a SocketErrorStatus value based on an error encountered by a socket operation.

Syntax


var socketErrorStatus = Windows.Networking.Sockets.SocketError.getStatus(hresult);

public static SocketErrorStatus GetStatus(
  int hresult
)

Public Shared Function GetStatus(
  hresult As Integer 
) As SocketErrorStatus

public:
static SocketErrorStatus GetStatus(
  int hresult
)

Parameters

hresult

Type: Number [JavaScript] | System.Int32 [.NET] | int32 [C++]

The error encountered by a socket operation represented as an HRESULT.

Return value

Type: SocketErrorStatus

The socket error status value for a socket operation.

Remarks

An error encountered on socket operation is returned as HRESULT value. The GetStatus method is used to convert an error from a socket operation to a SocketErrorStatus enumeration value. Most of the SocketErrorStatus enumeration values correspond to an error returned by the native Windows sockets operation.

The SocketError object and the GetStatus method would be used when the developer wants to programmatically handle errors that occur during the operation of an app.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

ID_CAP_NETWORKING [Windows Phone]

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

Capabilities

ID_CAP_NETWORKING [Windows Phone]

See also

SocketError
SocketErrorStatus