#include <winsock.h>
#else
#include <netdb.h>
-//#include <netinet/in.h>
+#include <netinet/in.h>
//#include <arpa/inet.h>
#include <unistd.h>
#include <sys/socket.h>
{
#ifdef WIN32
int e = WSAGetLastError();
- if (e == WSAEWOULDBLOCK || e == WSAECONNREFUSED)
+ if (e == WSAEWOULDBLOCK)
return 0;
+ switch (e)
+ {
+ case WSAECONNREFUSED:
+ Con_Printf("Connection refused\n");
+ return 0;
+ }
#else
- if (errno == EWOULDBLOCK || errno == ECONNREFUSED)
+ if (errno == EWOULDBLOCK)
return 0;
+ switch (errno)
+ {
+ case ECONNREFUSED:
+ Con_Printf("Connection refused\n");
+ return 0;
+ }
#endif
}
}
{
#ifdef WIN32
int e = WSAGetLastError();
- if (e == WSAEWOULDBLOCK || e == WSAECONNREFUSED)
+ if (e == WSAEWOULDBLOCK)
return 0;
+ switch (e)
+ {
+ case WSAECONNREFUSED:
+ Con_Printf("Connection refused\n");
+ return 0;
+ }
#else
- if (errno == EWOULDBLOCK || errno == ECONNREFUSED)
+ if (errno == EWOULDBLOCK)
return 0;
+ switch (errno)
+ {
+ case ECONNREFUSED:
+ Con_Printf("Connection refused\n");
+ return 0;
+ }
#endif
}
}