System.Net.Sockets.SocketError

Namespace: System.Net.Sockets

Assembly: System.Net.Sockets.dll

The SocketError enumeration provides a set of error codes that indicate the result of a socket operation.

Enum members

MemberValueDescription
Success0The operation completed successfully.
HostNotFound11001The host could not be found.
NetworkDown10050The network is down.
NetworkUnreachable10051The network is unreachable.
ConnectionReset10054The connection was reset by the remote host.
TimedOut10060The connection attempt timed out.
HostUnreachable10065The remote host is unreachable.
AddressFamilyNotSupported10047The address family is not supported.
NetworkReset10052The network has been reset.
AlreadyInProgress10037An operation is already in progress.
InvalidArgument10022An invalid argument was supplied.
MessageSize10040The buffer size was insufficient to hold the incoming data.
ProtocolNotSupported10045The protocol is not supported.
SocketNotSupported10044The socket type is not supported.
OperationAborted995The overlapped operation was aborted.
ConnectionRefused10061The remote host refused the connection.
HostDown10064The remote host is down.

Remarks

The values of SocketError correspond to the error codes defined by the underlying operating system. Use the SocketException class to obtain the error code when an exception is thrown.

See also