I have two programs, one is a server and one is a client. It is a game of jackblack that is played on the client. In one of my functions DisplayCards();
void Blackjack::DisplayCards()
{
sprintf(buf,"Player 1 (house) has the two cards. ");
send(sd2,buf,sizeof(buf),0);
This is on the Server's side. the code to receive this on the client side is:
// display cards
for(int i=0;i<8;i++)
{
n = recv (sd, buf, sizeof (buf), 0);
cout << buf << endl;
y++;
}
//---------------------------
which just receives 8 messages, one at a time, and prints each one to the screen before it increments and receiving the next one.
For some reason i am only receiving the last message sent in the DisplayCards() function. ive tried sending 2 messages, and i only receive the second, if i send 3 messages i only receive the third. Any help is greatly appreciated.