Hello everyone. Im sure this is a simple winsock question but maybe im wrong...
I searched everywhere and keep hitting dead ends.
Im just learning how to use winsock and still have yet to find a good tutorial. But i found a class which i will start with. Only problem is...
When i try to recv(...); the program waits until it receives somthing. Is there a way to do like:
char msg[256];
bool quit = false;
while(!quit)
{
if(recv(msg)) // as it goes through the loop, if it received somthing
cout << "User: " << msg << endl; // display it
if(GetKeyState(VK_RETURN)<0) // when you type enter
{
cout << "Message: "; // prompt for your message
cin.getline(msg,256); // input your message
send(msg); // send it
}
if(GetKeyState(VK_ESCAPE)<0)
quit = true;
}
And if you know of a good winsock tutorial that starts from the very basics, doesent do like the windows ones and most of them and just gives u what you put. I wana actualy understand what im doing : /
Thanks!
BTW: i know this code would never work and/or come up w/ errors, its just a general idea of what i would like to do.