I had a program that ran fine with Winsock.
But that only works on Windows.
So I decided to switch to SDL_net.
I thought I did okay, no syntax errors or anything when I compiled.
But on run the program froze up.
So I read about various SDL functions.
When I read about the receive function I noticed it said it will try to receive the exact amount of bytes you specify.
So I tryed to have my server (which is still winsock written) to end all of it's packets (used parts) with a }.
And this was the code I put in my client (SDL_net):
int AzSoket::resv(string &buf,int timeout)
{
buf = "";
char buffer[0];
bool cont = true;
while(SDLNet_TCP_Recv(qsd, buffer, 1) > 0 && cont)
{
if(buffer == "}")
{
cont = false;
return 1;
}
buf += buffer[0];
}
}
Yet this still does not work... any help please?