a program to print out the error strings for winsock errors

This commit is contained in:
Patrick Pelletier 2013-02-07 17:06:49 -08:00
parent 9709461457
commit 729651260d
2 changed files with 68 additions and 2 deletions

View File

@ -24,11 +24,13 @@ REGRESS_OBJS=regress.obj regress_buffer.obj regress_http.obj regress_dns.obj \
OTHER_OBJS=test-init.obj test-eof.obj test-weof.obj test-time.obj \
bench.obj bench_cascade.obj bench_http.obj bench_httpclient.obj \
test-changelist.obj
test-changelist.obj \
print-winsock-errors.obj
PROGRAMS=regress.exe \
test-init.exe test-eof.exe test-weof.exe test-time.exe \
test-changelist.exe
test-changelist.exe \
print-winsock-errors.exe
# Disabled for now:
# bench.exe bench_cascade.exe bench_http.exe bench_httpclient.exe
@ -52,6 +54,9 @@ test-weof.exe: test-weof.obj
test-time.exe: test-time.obj
$(CC) $(CFLAGS) $(LIBS) test-time.obj
print-winsock-errors.exe: print-winsock-errors.obj
$(CC) $(CFLAGS) $(LIBS) print-winsock-errors.obj
bench.exe: bench.obj
$(CC) $(CFLAGS) $(LIBS) bench.obj
bench_cascade.exe: bench_cascade.obj

View File

@ -0,0 +1,61 @@
#include <winsock2.h>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include "event2/util.h"
#include "event2/thread.h"
#define E(x) printf (#x " -> \"%s\"\n", evutil_socket_error_to_string (x));
int main (int argc, char **argv)
{
evthread_use_windows_threads ();
E(WSAEINTR);
E(WSAEACCES);
E(WSAEFAULT);
E(WSAEINVAL);
E(WSAEMFILE);
E(WSAEWOULDBLOCK);
E(WSAEINPROGRESS);
E(WSAEALREADY);
E(WSAENOTSOCK);
E(WSAEDESTADDRREQ);
E(WSAEMSGSIZE);
E(WSAEPROTOTYPE);
E(WSAENOPROTOOPT);
E(WSAEPROTONOSUPPORT);
E(WSAESOCKTNOSUPPORT);
E(WSAEOPNOTSUPP);
E(WSAEPFNOSUPPORT);
E(WSAEAFNOSUPPORT);
E(WSAEADDRINUSE);
E(WSAEADDRNOTAVAIL);
E(WSAENETDOWN);
E(WSAENETUNREACH);
E(WSAENETRESET);
E(WSAECONNABORTED);
E(WSAECONNRESET);
E(WSAENOBUFS);
E(WSAEISCONN);
E(WSAENOTCONN);
E(WSAESHUTDOWN);
E(WSAETIMEDOUT);
E(WSAECONNREFUSED);
E(WSAEHOSTDOWN);
E(WSAEHOSTUNREACH);
E(WSAEPROCLIM);
E(WSASYSNOTREADY);
E(WSAVERNOTSUPPORTED);
E(WSANOTINITIALISED);
E(WSAEDISCON);
E(WSATYPE_NOT_FOUND);
E(WSAHOST_NOT_FOUND);
E(WSATRY_AGAIN);
E(WSANO_RECOVERY);
E(WSANO_DATA);
return EXIT_SUCCESS;
}