Hello,
I have done a board search, but I can't seem to find a simple answer to my question. I've even read Beej's document, though I did not see anything that could answer my question.
Firstly, to lay a foundation, I've been working on a multi-client echo server for Linux. Now, that I have done that successfuly, I want to make a semi-chat style program. Everything is working as planned, except for the client.
My client works along this concept:
- Connect to server
- Start infinite loop
- -- Send data
- -- Read data
- Close socket
The problem is that with my loop, I have to send data in order for it to receive data. This was more on the lines of an echo server, but I'm at a loss of how I would read data from the server when new information was sent, but still send data back accordingly. How should my client's concept be?
- Stack Overflow