Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 CdcString GetSocketErrorMsg (int code)
00024 {
00025 switch (code)
00026 {
00027 case WSAEINTR:
00028 return CdcString ("Interrupted function call");
00029 case WSAEBADF:
00030 return CdcString ("Bad file number");
00031 case WSAEACCES:
00032 return CdcString ("Permission denied");
00033 case WSAEFAULT:
00034 return CdcString ("Bad address");
00035 case WSAEINVAL:
00036 return CdcString ("Invalid argument");
00037 case WSAEMFILE:
00038 return CdcString ("Too many open sockets");
00039 case WSAEWOULDBLOCK:
00040 return CdcString ("Resource temporarily unavailable");
00041 case WSAEINPROGRESS:
00042 return CdcString ("Operation now in progress");
00043 case WSAEALREADY:
00044 return CdcString ("Operation already in progress");
00045 case WSAENOTSOCK:
00046 return CdcString ("Socket operation on non-socket");
00047 case WSAEDESTADDRREQ:
00048 return CdcString ("Destination address required ");
00049 case WSAEMSGSIZE:
00050 return CdcString ("Message too long");
00051 case WSAEPROTOTYPE:
00052 return CdcString ("Protocol wrong type for socket");
00053 case WSAENOPROTOOPT:
00054 return CdcString ("Bad protocol option");
00055 case WSAEPROTONOSUPPORT:
00056 return CdcString ("Protocol not supported");
00057 case WSAESOCKTNOSUPPORT:
00058 return CdcString ("Socket type not supported");
00059 case WSAEOPNOTSUPP:
00060 return CdcString ("Operation not supported");
00061 case WSAEPFNOSUPPORT:
00062 return CdcString ("Protocol family not supported");
00063 case WSAEAFNOSUPPORT:
00064 return CdcString ("Address family not supported by protocol family");
00065 case WSAEADDRINUSE:
00066 return CdcString ("Address already in use");
00067 case WSAEADDRNOTAVAIL:
00068 return CdcString ("Cannot assign requested address");
00069 case WSAENETDOWN:
00070 return CdcString ("Network is down");
00071 case WSAENETUNREACH:
00072 return CdcString ("Network is unreachable");
00073 case WSAENETRESET:
00074 return CdcString ("Network dropped connection on reset");
00075 case WSAECONNABORTED:
00076 return CdcString ("Software caused connection abort");
00077 case WSAECONNRESET:
00078 return CdcString ("Connection reset by peer");
00079 case WSAENOBUFS:
00080 return CdcString ("No buffer space available");
00081 case WSAEISCONN:
00082 return CdcString ("Socket is already connected");
00083 case WSAENOTCONN:
00084 return CdcString ("Socket is not connected");
00085 case WSAESHUTDOWN:
00086 return CdcString ("Cannot send after socket shutdown");
00087 case WSAETIMEDOUT:
00088 return CdcString ("Connection timed out");
00089 case WSAECONNREFUSED:
00090 return CdcString ("Connection refused");
00091 case WSAEHOSTDOWN:
00092 return CdcString ("Host is down");
00093 case WSAEHOSTUNREACH:
00094 return CdcString ("No route to host");
00095 case WSAEPROCLIM:
00096 return CdcString ("Too many processes");
00097 case WSASYSNOTREADY:
00098 return CdcString ("Network subsystem is unavailable");
00099 case WSAVERNOTSUPPORTED:
00100 return CdcString ("WINSOCK.DLL version out of range");
00101 case WSANOTINITIALISED:
00102 return CdcString ("Successful WSAStartup not yet performed");
00103 case WSAEDISCON:
00104 return CdcString ("shutdown in progress");
00105 case WSAHOST_NOT_FOUND:
00106 return CdcString ("Host not found");
00107 case WSATRY_AGAIN:
00108 return CdcString ("Non-authoritative host not found");
00109 case WSANO_RECOVERY:
00110 return CdcString ("This is a non-recoverable error");
00111 case WSANO_DATA:
00112 return CdcString ("Valid name, no data record of requested type");
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 case WSASYSCALLFAILURE:
00130 return CdcString ("System call failure");
00131
00132
00133 default:
00134 char buff [40];
00135 sprintf (buff, "Unknown error - %d", code);
00136 return CdcString (buff);
00137 }
00138 return EMPTY_STR;
00139 }
00140