SocketError.GetStatus(Int32) Method

Definition

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

public:
 static SocketErrorStatus GetStatus(int hresult);
 static SocketErrorStatus GetStatus(int const& hresult);
public static SocketErrorStatus GetStatus(int hresult);
function getStatus(hresult)
Public Shared Function GetStatus (hresult As Integer) As SocketErrorStatus

Parameters

hresult
Int32

int

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

Returns

The socket error status value for a socket operation.

Windows requirements

App capabilities
ID_CAP_NETWORKING [Windows Phone]

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.

Applies to

See also