A general sockets question. Is there a parameter(s) that I need to set in order for this code to execute without the need for the Sleep() function? Without the Sleep(), the server starts to miss messages.

Both the client and server are running on the same 2Ghz machine so I would think that the computer is plenty fast.

Client code:
Code:
for (x = 1 ; x < 99 ; x++)
{
   sprintf(buffer, "%ld", CLIENT_REC);
   strcpy(Client.FName, "Joe");
   strcpy(Client.LName, "Public");
   Client.Age = 21;
   memcpy(buffer+4, &Client, sizeof(Client));
   RecSize = sizeof(Client) + sizeof(CLIENT_REC);


   if (send(s, buffer, /*strlen(buffer)*/ RecSize, 0) == -1)
   {
      printf("Can't send message\n"); 
      sockEnd(); 
      return 3; 
   }	

Sleep(55);  /*any value less than this, the server starts missing them */
}
Server code:
Code:
do
{
	MsgLen = recv(sSocket, buffer, BUFLEN, 0);

	if (MsgLen <= 0)
	{
		break;
	}

	buffer[MsgLen] = '\0';
	strcat(msg,buffer);

	strncpy(message, buffer, 4);
	message[4] = '\0';

	MsgType = atol(message);

	switch(MsgType)
	{
     	    case CLIENT_REC:
		/* pull the client structure out of the buffer */
				memcpy(&Client, buffer+4, sizeof(Client));
		fprintf(fp, "%d: Client: [%s] [%s] [%d]\n", pid, Client.FName, Client.LName, Client.Age);
		break;
	   default:
		printf("Unknown Message Type\n");
		break;
	}

	memset(msg,0,MSG_SIZE); 
	memset(buffer,0,BUFLEN);

} while(1);