I am currently planning an instant messagin program to help me leanr more about network programming, but I have a question about how I should lay it out.
You see the concept of sending plain text in packets is simple but I can't just call send and recv functions as the order of communcation is then hardcoded into the program. What I mean is if bob is talking to anne and bob tries to send two seperate messages in a row without anne sending a response, the program would not be able to handle that. So I wanted to ask how I would go about building in the capability for 'one-sided' conversations. I was thinking about forking the program so there was always a recv call waiting as well as a send. Is that a good idea or are there better ways of doing it, which are not overly complex.