Export (0) Print
Expand All

SocketError Enumeration

Defines error codes for the Socket class.

Namespace:  System.Net.Sockets
Assemblies:   System.Net.Primitives (in System.Net.Primitives.dll)
  System (in System.dll)

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 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.
AddressNotAvailableThe selected IP address is not 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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft