SocketError Enumeration

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Defines error codes for the Socket class.

Namespace:  System.Net.Sockets
Assembly:  System (in System.dll)

public enum SocketError

Member nameDescription
SuccessThe Socket operation succeeded.
SocketErrorAn unspecified Socket error has occurred.
InterruptedA blocking Socket call was canceled.
AccessDeniedAn attempt was made to access a Socket in a way that is forbidden by its access permissions.
FaultAn invalid pointer address was detected by the underlying socket provider.
InvalidArgumentAn invalid argument was supplied to a Socket member.
TooManyOpenSocketsThere are too many open sockets in the underlying socket provider.
WouldBlockAn operation on a nonblocking socket cannot be completed immediately.
InProgressA blocking operation is in progress.
AlreadyInProgressThe nonblocking Socket already has an operation in progress.
NotSocketA Socket operation was attempted on a non-socket.
DestinationAddressRequiredA required address was omitted from an operation on a Socket.
MessageSizeThe datagram is too long.
ProtocolTypeThe protocol type is incorrect for this Socket.
ProtocolOptionAn unknown, invalid, or unsupported option or level was used with a Socket.
ProtocolNotSupportedThe protocol is not implemented or has not been configured.
SocketNotSupportedThe support for the specified socket type does not exist in this address family.
OperationNotSupportedThe address family is not supported by the protocol family.
ProtocolFamilyNotSupportedThe protocol family is not implemented or has not been configured.
AddressFamilyNotSupportedThe address family specified is not supported. This error is returned if the IPv6 address family was specified and the IPv6 stack is not installed on the local machine. This error is returned if the IPv4 address family was specified and the IPv4 stack is not installed on the local machine.
AddressAlreadyInUseOnly one use of an address is normally permitted.
AddressNotAvailableThe selected IP address is not valid in this context.
NetworkDownThe network is not available.
NetworkUnreachableNo route to the remote host exists.
NetworkResetThe application tried to set KeepAlive on a connection that has already timed out.
ConnectionAbortedThe connection was aborted by the .NET Framework or the underlying socket provider.
ConnectionResetThe connection was reset by the remote peer.
NoBufferSpaceAvailableNo free buffer space is available for a Socket operation.
IsConnectedThe Socket is already connected.
NotConnectedThe application tried to send or receive data, and the Socket is not connected.
ShutdownA request to send or receive data was disallowed because the Socket has already been closed.
TimedOutThe connection attempt timed out, or the connected host has failed to respond.
ConnectionRefusedThe remote host is actively refusing a connection.
HostDownThe operation failed because the remote host is down.
HostUnreachableThere is no network route to the specified host.
ProcessLimitToo many processes are using the underlying socket provider.
SystemNotReadyThe network subsystem is unavailable.
VersionNotSupportedThe version of the underlying socket provider is out of range.
NotInitializedThe underlying socket provider has not been initialized.
DisconnectingA graceful shutdown is in progress.
TypeNotFoundThe specified class was not found.
HostNotFoundNo such host is known. The name is not an official host name or alias.
TryAgainThe name of the host could not be resolved. Try again later.
NoRecoveryThe error is unrecoverable or the requested database cannot be located.
NoDataThe requested name or IP address was not found on the name server.

Most of these errors are returned by the underlying socket provider.