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:
parent
7fa677ccf5
commit
4943723a8b
3 changed files with 86 additions and 83 deletions
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
#include "qtv.h"
|
#include "qtv.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#define curtime Sys_Milliseconds()
|
#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)
|
if (er == EWOULDBLOCK || er == EAGAIN)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Sys_Printf(cluster, "udp send error %i\n", er);
|
Sys_Printf(cluster, "udp send error %i (%s)\n", er, strerror(er));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
#include "qtv.h"
|
#include "qtv.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "bsd_string.h"
|
#include "bsd_string.h"
|
||||||
|
|
||||||
|
@ -200,7 +201,7 @@ SOCKET QW_InitUDPSocket(int port, qboolean ipv6)
|
||||||
|
|
||||||
if( bind (sock, (void *)address, addrlen) == -1)
|
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);
|
closesocket(sock);
|
||||||
return INVALID_SOCKET;
|
return INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
#include "qtv.h"
|
#include "qtv.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "bsd_string.h"
|
#include "bsd_string.h"
|
||||||
|
|
||||||
|
@ -260,7 +261,7 @@ SOCKET Net_TCPListen(int port, qboolean ipv6)
|
||||||
|
|
||||||
if( bind (sock, address, addrsize) == -1)
|
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);
|
closesocket(sock);
|
||||||
return INVALID_SOCKET;
|
return INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
|
@ -692,7 +693,7 @@ qboolean Net_WriteUpstream(sv_t *qtv)
|
||||||
err = qerrno;
|
err = qerrno;
|
||||||
if (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");
|
strcpy(qtv->status, "Network error\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -879,7 +880,7 @@ qboolean Net_ReadStream(sv_t *qtv)
|
||||||
if (qtv->sourcefile)
|
if (qtv->sourcefile)
|
||||||
Sys_Printf(qtv->cluster, "Stream %i: Error: End of file\n", qtv->streamid);
|
Sys_Printf(qtv->cluster, "Stream %i: Error: End of file\n", qtv->streamid);
|
||||||
else if (read)
|
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
|
else
|
||||||
Sys_Printf(qtv->cluster, "Stream %i: Error: server %s disconnected\n", qtv->streamid, qtv->server);
|
Sys_Printf(qtv->cluster, "Stream %i: Error: server %s disconnected\n", qtv->streamid, qtv->server);
|
||||||
if (qtv->sourcesock != INVALID_SOCKET)
|
if (qtv->sourcesock != INVALID_SOCKET)
|
||||||
|
|
Loading…
Reference in a new issue