SocketError Enumeration

Note: This enumeration is new in the .NET Framework version 2.0.

Defines error codes for the Socket class.

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

public enum SocketError
public enum SocketError
public enum SocketError

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

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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions