socket/tcp/udp errors more verbose (strerror)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3872 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Lance 2011-07-14 09:18:04 +00:00
parent 7fa677ccf5
commit 4943723a8b
3 changed files with 86 additions and 83 deletions

View file

@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "qtv.h"
#include <string.h>
#define curtime Sys_Milliseconds()
@ -43,7 +44,7 @@ void NET_SendPacket(cluster_t *cluster, SOCKET sock, int length, void *data, net
if (er == EWOULDBLOCK || er == EAGAIN)
return;
Sys_Printf(cluster, "udp send error %i\n", er);
Sys_Printf(cluster, "udp send error %i (%s)\n", er, strerror(er));
}
}

View file

@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "qtv.h"
#include <string.h>
#include "bsd_string.h"
@ -200,7 +201,7 @@ SOCKET QW_InitUDPSocket(int port, qboolean ipv6)
if( bind (sock, (void *)address, addrlen) == -1)
{
printf("socket bind error %i\n", qerrno);
printf("socket bind error %i (%s)\n", qerrno, strerror(qerrno));
closesocket(sock);
return INVALID_SOCKET;
}

View file

@ -53,6 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "qtv.h"
#include <string.h>
#include "bsd_string.h"
@ -260,7 +261,7 @@ SOCKET Net_TCPListen(int port, qboolean ipv6)
if( bind (sock, address, addrsize) == -1)
{
printf("socket bind error %i\n", qerrno);
printf("socket bind error %i (%s)\n", qerrno, strerror(qerrno));
closesocket(sock);
return INVALID_SOCKET;
}
@ -692,7 +693,7 @@ qboolean Net_WriteUpstream(sv_t *qtv)
err = qerrno;
if (qerrno)
{
Sys_Printf(qtv->cluster, "Stream %i: Error: source socket error %i\n", qtv->streamid, qerrno);
Sys_Printf(qtv->cluster, "Stream %i: Error: source socket error %i (%s)\n", qtv->streamid, qerrno, strerror(qerrno));
strcpy(qtv->status, "Network error\n");
}
else
@ -879,7 +880,7 @@ qboolean Net_ReadStream(sv_t *qtv)
if (qtv->sourcefile)
Sys_Printf(qtv->cluster, "Stream %i: Error: End of file\n", qtv->streamid);
else if (read)
Sys_Printf(qtv->cluster, "Stream %i: Error: source socket error %i\n", qtv->streamid, qerrno);
Sys_Printf(qtv->cluster, "Stream %i: Error: source socket error %i (%s)\n", qtv->streamid, qerrno, strerror(qerrno));
else
Sys_Printf(qtv->cluster, "Stream %i: Error: server %s disconnected\n", qtv->streamid, qtv->server);
if (qtv->sourcesock != INVALID_SOCKET)