I have written a chat program. But I am having touble with reading both the keybord and port at the same time. If I write cin>> the program is stuck here until something comes in if i don't write it, it is impossible to write anything on the console.
I'm using Visual Studio 6.0 and are using winsock to comunicate between the client and server. If I use the client to listen to the keybord, and server to listen to the port everything works. but I cant get the client(or server) to do both.
I tried to use threads but it I had some of the same trubble there. Is it possible to time out the cin>> at a spesific time if nothing is typed?
How is it possible to solve this problem?