//
// Error String
//
char *WSock::ErrText( int err )
{
static char buf[80];
switch (err)
{
case WSAEINTR: // 10004
return "(10004) WSAEINTR - Interrupted function call.";
case WSAEACCES: // 10013
return "(10013) WSAEACCES - Permission Denied.";
case WSAEFAULT: // 10014
return "(10014) WSAEFAULT - Bad Address.";
case WSAEINVAL: // 10022
return "(10022) WSAEINVAL - Invalid Argument.";
case WSAEMFILE: // 10024
return "(10024) WSAEMFILE - Too many open files.";
case WSAEWOULDBLOCK: // 10035
return "(10035) WSAEWOULDBLOCK - Resource temporarily unavailable.";
case WSAEINPROGRESS: // 10036
return "(10036) WSAEINPROGRESS , Operation now in progress.";
case WSAEALREADY: // 10037
return "(10037) WSAEALREADY - Operation already in progress.";
case WSAENOTSOCK: // 10038
return "(10038) WSAENOTSOCK - Socket operation on nonsocket.";
case WSAEDESTADDRREQ: // 10039
return "(10039) WSAEDESTADDRREQ - Destination address required.";
case WSAEMSGSIZE: // 10040
return "(10040) WSAEMSGSIZE - Message too long.";
case WSAEPROTOTYPE: // 10041
return "(10041) WSAEPROTOTYPE - Protocol wrong type for socket.";
case WSAENOPROTOOPT: // 10042
return "(10042) WSAENOPROTOOPT - Bad protocol option.";
case WSAEPROTONOSUPPORT: // 10043
return "(10043) WSAEPROTONOSUPPORT - Protocol not supported.";
case WSAESOCKTNOSUPPORT: // 10044
return "(10044) WSAESOCKTNOSUPPORT - Socket type not supported.";
case WSAEOPNOTSUPP: // 10045
return "(10045) WSAEOPNOTSUPP - Operation not supported.";
case WSAEPFNOSUPPORT: // 10046
return "(10046) WSAEPFNOSUPPORT - Protobol family not supported.";
case WSAEAFNOSUPPORT: // 10047
return "(10047) WSAEAFNOSUPPORT - Address family not supported by protocol family.";
case WSAEADDRINUSE: // 10048
return "(10048) WSAEADDRINUSE - Address already in use.";
case WSAEADDRNOTAVAIL: // 10049
return "(10049) WSAEADDRNOTAVAIL - Cannot assign requested address.";
case WSAENETDOWN: // 10050
return "(10050) WSAENETDOWN - Network is down.";
case WSAENETUNREACH: // 10051
return "(10051) WSAENETUNREACH - Network is unreachable.";
case WSAENETRESET: // 10052
return "(10052) WSAENETRESET - Network dropped connection on reset.";
case WSAECONNABORTED: // 10053
return "(10053) WSAECONNABORTED - Software caused connection abort.";
case WSAECONNRESET: // 10054
return "(10054) WSAECONNRESET - Connection reset by peer.";
case WSAENOBUFS: // 10055
return "(10055) WSAENOBUFS - No buffer space available.";
case WSAEISCONN: // 10056
return "(10056) WSAEIRCONN - Socket is already connected.";
case WSAENOTCONN: // 10057
return "(10057) WSAENOTCONN - Socket is not connected.";
case WSAESHUTDOWN: // 10058
return "(10058) WSAESHUTDOWN - Cannot Twx/Rcv after socket shutdown.";
case WSAETIMEDOUT: // 10060
return "(10060) WSAETIMEDOUT - Connection timed out.";
case WSAECONNREFUSED: // 10061
return "(10061) WSAECONNREFUSED - Connection refused.";
case WSAEHOSTDOWN: // 10064
return "(10064) WSAEHOSTDOWN - Host is down.";
case WSAEHOSTUNREACH: // 10065
return "(10065) WSAEHOSTUNREACH - No route to host.";
case WSAEPROCLIM: // 10067
return "(10067) WSAEPROCLIM - Too many processes.";
case WSASYSNOTREADY: // 10091
return "(10091) WSASYSNOTREADY - Network subsystem is unavailable.";
case WSAVERNOTSUPPORTED: // 10092
return "(10092) WSAVERNOTSUPPORTED - Winsock.dll version out of range.";
case WSANOTINITIALISED: // 10093
return "(10093) WSANOTINITIALISED - Successful WSARtartup not yet performed.";
case WSAEDISCON: // 10101
return "(10101) WSAEDISCON - Graceful shutdown in progress.";
#ifdef WSATYPE_NOT_FOUND
case WSATYPE_NOT_FOUND: // 10109
return "(10109) WSATYPE_NOT_FOUND - Class type not found.";
#endif
case WSAHOST_NOT_FOUND: // 11001
return "(11001) WSAHOST_NOT_FOUND - Host not found.";
case WSATRY_AGAIN: // 11002
return "(11002) WSATRY_AGAIN - Nonauthoritative host not found.";
case WSANO_RECOVERY: // 11003
return "(11003) WSANO_RECOVERY - This is a nonrecoverable error.";
case WSANO_DATA: // 11004
return "(11004) WSANO_DATA - Valid name, no data record of requested type.";
default:
sprintf( buf, "(%d)", err );
return buf;
break;
}
}