git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@118
d7cf8633-e32d-0410-b094-
e92efae38249
int UDP_CheckNewConnections (void)
{
unsigned long available;
+ struct sockaddr_in from;
+ socklen_t fromlen;
+ char buff[1];
if (net_acceptsocket == -1)
return -1;
Sys_Error ("UDP: ioctlsocket (FIONREAD) failed\n");
if (available)
return net_acceptsocket;
+ recvfrom (net_acceptsocket, buff, 0, 0, &from, &fromlen);
return -1;
}
if (net_acceptsocket == -1)
return -1;
- if (precvfrom (net_acceptsocket, buf, sizeof(buf), MSG_PEEK, NULL, NULL) > 0)
+ if (precvfrom (net_acceptsocket, buf, sizeof(buf), MSG_PEEK, NULL, NULL) >= 0)
{
return net_acceptsocket;
}