I am sending two messages from server.exe like this:
sprintf( buffer,"%d %s",1,data1);
SDLNet_TCP_Send(clientSocket, buffer, strlen(buffer)+1); // first message
sprintf( buffer,"%d %s",2,data2);
SDLNet_TCP_Send(clientSocket, buffer, strlen(buffer)+1); // second message
and I am reading messages from client.exe like this:
if(SDLNet_CheckSockets(socketSet, 0)>0)
{
if(SDLNet_SocketReady(clientSocket)>0)
{
if(SDLNet_TCP_Recv(clientSocket, buffer, 5000)>0)
{
//there i take only first message
}
}
}
Why am I not receiving all sent messages in the client?