DrawNetworkText("Looking for local network server ...");
- if (SDLNet_CheckSockets(udp_socket_set, 1000) == 1)
+ if (SDLNet_CheckSockets(udp_socket_set, 500) == 1)
{
int num_packets = SDLNet_UDP_Recv(udp, &packet);
StartNetworkServer(port);
/* wait for server to start up and try connecting several times */
- for (i = 0; i < 6; i++)
+ for (i = 0; i < 30; i++)
{
- Delay(500); /* wait 500 ms == 0.5 seconds */
-
if ((sfd = SDLNet_TCP_Open(&ip))) /* connected */
{
DrawNetworkText_Success("Successfully connected!");
SDLNet_TCP_AddSocket(rfds, sfd);
return TRUE;
}
+
+ Delay(100);
}
DrawNetworkText_Failed("Failed to connect to network server!");