Im working on a program that can send data between a client and a server, kind of like a peer-to-peer chat program.
I was wondering if anyone can show me a basic layout for a Win32 Multithreaded Winsock program.
Ive attached the code for my server on this post and my client on the next post, could someone please help point out the errors? The server is extremely laggy, consuming 99% of my CPU (3 GHZ), also the server cannot send data (or the client cannot receive it).
The client sends fine but doesnt receive data from the server.
The server code has:
2 threads (1 for accepting a client, 1 for receiving data from the client)
The code attached is compilable, so if anyone can try it out and tell me whats wrong? Or post an improved/fixed version of the code.
Thanx