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
Member | Value | Description |
---|---|---|
Success | 0 | The operation completed successfully. |
HostNotFound | 11001 | The host could not be found. |
NetworkDown | 10050 | The network is down. |
NetworkUnreachable | 10051 | The network is unreachable. |
ConnectionReset | 10054 | The connection was reset by the remote host. |
TimedOut | 10060 | The connection attempt timed out. |
HostUnreachable | 10065 | The remote host is unreachable. |
AddressFamilyNotSupported | 10047 | The address family is not supported. |
NetworkReset | 10052 | The network has been reset. |
AlreadyInProgress | 10037 | An operation is already in progress. |
InvalidArgument | 10022 | An invalid argument was supplied. |
MessageSize | 10040 | The buffer size was insufficient to hold the incoming data. |
ProtocolNotSupported | 10045 | The protocol is not supported. |
SocketNotSupported | 10044 | The socket type is not supported. |
OperationAborted | 995 | The overlapped operation was aborted. |
ConnectionRefused | 10061 | The remote host refused the connection. |
HostDown | 10064 | The 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.