Logo
~Sockets~
~Examples~
~Contact~


socket_include.cpp

Go to the documentation of this file.
00001 
00005 /*
00006 Copyright (C) 2004-2007  Anders Hedstrom
00007 
00008 This library is made available under the terms of the GNU GPL.
00009 
00010 If you would like to use this library in a closed-source application,
00011 a separate license agreement is available. For information about 
00012 the closed-source license agreement for the C++ sockets library,
00013 please visit http://www.alhem.net/Sockets/license.html and/or
00014 email license@alhem.net.
00015 
00016 This program is free software; you can redistribute it and/or
00017 modify it under the terms of the GNU General Public License
00018 as published by the Free Software Foundation; either version 2
00019 of the License, or (at your option) any later version.
00020 
00021 This program is distributed in the hope that it will be useful,
00022 but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 GNU General Public License for more details.
00025 
00026 You should have received a copy of the GNU General Public License
00027 along with this program; if not, write to the Free Software
00028 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00029 */
00030 #include <stdio.h>
00031 
00032 // only to be included in win32 projects
00033 const char *StrError(int x) 
00034 {
00035 static  char tmp[100];
00036         switch (x)
00037         {
00038         case 10004: return "Interrupted function call.";
00039         case 10013: return "Permission denied.";
00040         case 10014: return "Bad address.";
00041         case 10022: return "Invalid argument.";
00042         case 10024: return "Too many open files.";
00043         case 10035: return "Resource temporarily unavailable.";
00044         case 10036: return "Operation now in progress.";
00045         case 10037: return "Operation already in progress.";
00046         case 10038: return "Socket operation on nonsocket.";
00047         case 10039: return "Destination address required.";
00048         case 10040: return "Message too long.";
00049         case 10041: return "Protocol wrong type for socket.";
00050         case 10042: return "Bad protocol option.";
00051         case 10043: return "Protocol not supported.";
00052         case 10044: return "Socket type not supported.";
00053         case 10045: return "Operation not supported.";
00054         case 10046: return "Protocol family not supported.";
00055         case 10047: return "Address family not supported by protocol family.";
00056         case 10048: return "Address already in use.";
00057         case 10049: return "Cannot assign requested address.";
00058         case 10050: return "Network is down.";
00059         case 10051: return "Network is unreachable.";
00060         case 10052: return "Network dropped connection on reset.";
00061         case 10053: return "Software caused connection abort.";
00062         case 10054: return "Connection reset by peer.";
00063         case 10055: return "No buffer space available.";
00064         case 10056: return "Socket is already connected.";
00065         case 10057: return "Socket is not connected.";
00066         case 10058: return "Cannot send after socket shutdown.";
00067         case 10060: return "Connection timed out.";
00068         case 10061: return "Connection refused.";
00069         case 10064: return "Host is down.";
00070         case 10065: return "No route to host.";
00071         case 10067: return "Too many processes.";
00072         case 10091: return "Network subsystem is unavailable.";
00073         case 10092: return "Winsock.dll version out of range.";
00074         case 10093: return "Successful WSAStartup not yet performed.";
00075         case 10101: return "Graceful shutdown in progress.";
00076         case 10109: return "Class type not found.";
00077         case 11001: return "Host not found.";
00078         case 11002: return "Nonauthoritative host not found.";
00079         case 11003: return "This is a nonrecoverable error.";
00080         case 11004: return "Valid name, no data record of requested type.";
00081 
00082         default:
00083                 break;
00084         }
00085         sprintf(tmp, "Winsock error code: %d", x);
00086         return tmp;
00087 }
00088 
00089 
Page, code, and content Copyright (C) 2007 by Anders Hedström
Generated for C++ Sockets by  doxygen 1.4.4