//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ namespace System.Net.Sockets { using System; /// /// /// Defines socket error constants. /// /// public enum SocketErrors : int { /// /// /// The operation completed successfully. /// /// Success = 0, /// /// /// The socket is invalid. /// /// InvalidSocket = (-1), /// /// /// The socket has an error. /// /// SocketError = (-1), /// /// /// Overlapped operations will complete later. /// /// WSA_IO_PENDING = 997, // Winsock 2 Defines this value just to be ERROR_IO_PENDING or 997 /// /// /// [To be supplied.] /// /// ERROR_OPERATION_ABORTED = 995, /* * All Windows Sockets error constants are biased by WSABASEERR from * the "normal" */ /// /// /// The base value of all socket error constants. All other socket errors are /// offset from this value. /// /// WSABASEERR = 10000, /* * Windows Sockets definitions of regular Microsoft C error constants */ /// /// /// A blocking socket call was canceled. /// /// WSAEINTR = (WSABASEERR+4), /// /// /// [To be supplied.] /// /// WSAEBADF = (WSABASEERR+9), /// /// /// Permission denied. /// /// WSAEACCES = (WSABASEERR+13), /// /// /// Bad address. /// /// WSAEFAULT = (WSABASEERR+14), /// /// /// Invalid argument. /// /// WSAEINVAL = (WSABASEERR+22), /// /// /// Too many open /// files. /// /// WSAEMFILE = (WSABASEERR+24), /* * Windows Sockets definitions of regular Berkeley error constants */ /// /// /// Resource temporarily unavailable. /// /// WSAEWOULDBLOCK = (WSABASEERR+35), /// /// /// Operation now in progress. /// /// WSAEINPROGRESS = (WSABASEERR+36), /// /// /// Operation already in progress. /// /// WSAEALREADY = (WSABASEERR+37), /// /// /// Socket operation on nonsocket. /// /// WSAENOTSOCK = (WSABASEERR+38), /// /// /// Destination address required. /// /// WSAEDESTADDRREQ = (WSABASEERR+39), /// /// /// Message too long. /// /// WSAEMSGSIZE = (WSABASEERR+40), /// /// /// Protocol wrong type for socket. /// /// WSAEPROTOTYPE = (WSABASEERR+41), /// /// /// Bad protocol option. /// /// WSAENOPROTOOPT = (WSABASEERR+42), /// /// /// Protocol not supported. /// /// WSAEPROTONOSUPPORT = (WSABASEERR+43), /// /// /// Socket type not supported. /// /// WSAESOCKTNOSUPPORT = (WSABASEERR+44), /// /// /// Operation not supported. /// /// WSAEOPNOTSUPP = (WSABASEERR+45), /// /// /// Protocol family not supported. /// /// WSAEPFNOSUPPORT = (WSABASEERR+46), /// /// /// Address family not supported by protocol family. /// /// WSAEAFNOSUPPORT = (WSABASEERR+47), /// /// Address already in use. /// WSAEADDRINUSE = (WSABASEERR+48), /// /// /// Cannot assign requested address. /// /// WSAEADDRNOTAVAIL = (WSABASEERR+49), /// /// /// Network is down. /// /// WSAENETDOWN = (WSABASEERR+50), /// /// /// Network is unreachable. /// /// WSAENETUNREACH = (WSABASEERR+51), /// /// /// Network dropped connection on reset. /// /// WSAENETRESET = (WSABASEERR+52), /// /// /// Software caused connection to abort. /// /// WSAECONNABORTED = (WSABASEERR+53), /// /// /// Connection reset by peer. /// /// WSAECONNRESET = (WSABASEERR+54), /// /// No buffer space available. /// WSAENOBUFS = (WSABASEERR+55), /// /// /// Socket is already connected. /// /// WSAEISCONN = (WSABASEERR+56), /// /// /// Socket is not connected. /// /// WSAENOTCONN = (WSABASEERR+57), /// /// /// Cannot send after socket shutdown. /// /// WSAESHUTDOWN = (WSABASEERR+58), /// /// /// [To be supplied.] /// /// WSAETOOMANYREFS = (WSABASEERR+59), /// /// /// Connection timed out. /// /// WSAETIMEDOUT = (WSABASEERR+60), /// /// /// Connection refused. /// /// WSAECONNREFUSED = (WSABASEERR+61), /// /// /// [To be supplied.] /// /// WSAELOOP = (WSABASEERR+62), /// /// /// [To be supplied.] /// /// WSAENAMETOOLONG = (WSABASEERR+63), /// /// /// Host is down. /// /// WSAEHOSTDOWN = (WSABASEERR+64), /// /// /// No route to host. /// /// WSAEHOSTUNREACH = (WSABASEERR+65), /// /// /// [To be supplied.] /// /// WSAENOTEMPTY = (WSABASEERR+66), /// /// /// Too many processes. /// /// WSAEPROCLIM = (WSABASEERR+67), /// /// /// [To be supplied.] /// /// WSAEUSERS = (WSABASEERR+68), /// /// /// [To be supplied.] /// /// WSAEDQUOT = (WSABASEERR+69), /// /// /// [To be supplied.] /// /// WSAESTALE = (WSABASEERR+70), /// /// /// [To be supplied.] /// /// WSAEREMOTE = (WSABASEERR+71), /// /// /// Graceful shutdown in progress. /// /// WSAEDISCON = (WSABASEERR+101), /* * Extended Windows Sockets error constant definitions */ /// /// /// Network subsystem is unavailable. /// /// WSASYSNOTREADY = (WSABASEERR+91), /// /// /// Winsock.dll out of range. /// /// WSAVERNOTSUPPORTED = (WSABASEERR+92), /// /// /// Successful startup not yet performed. /// /// WSANOTINITIALISED = (WSABASEERR+93), /* * Error return codes from gethostbyname() and gethostbyaddr() * = (when using the resolver). Note that these errors are * retrieved via WSAGetLastError() and must therefore follow * the rules for avoiding clashes with error numbers from * specific implementations or language run-time systems. * For this reason the codes are based at WSABASEERR+1001. * Note also that [WSA]NO_ADDRESS is defined only for * compatibility purposes. */ /// /// /// Host not found (Authoritative Answer: Host not found). /// /// WSAHOST_NOT_FOUND = (WSABASEERR+1001), /// /// /// Nonauthoritative host not found (Non-Authoritative: Host not found, or SERVERFAIL). /// /// WSATRY_AGAIN = (WSABASEERR+1002), /// /// /// This is a nonrecoverable error (Non recoverable errors, FORMERR, REFUSED, NOTIMP). /// /// WSANO_RECOVERY = (WSABASEERR+1003), /// /// /// Valid name, no data record of requested type. /// /// WSANO_DATA = (WSABASEERR+1004), /// /// /// No address, look for MX record. /// /// WSANO_ADDRESS = WSANO_DATA, } }