I’m thinking of writing a server application — along the lines of mySQL or Apache.
Primary requirements:
- Clients will communicate with the server via TCP / IP (sockets)
- The server will spawn a new child process for processing requests (ala Apache)
Ideally, I would like to use the BOOST libraries, rather than trying to invent my own. There must be code somewhere that does most of what I'm trying to do, so I can use it (or at least part of it as a starting point), can someone point me to a useful link?
In the case (I hope it is unlikely) that there is no code that I can use as a starting point, someone can specify the most suitable BOOST libraries for use - and a general guide to the implementation.
My main concern is to find out when one of the children crashed. AFAIK, there are two ways to do this:
- Use of heart contractions between parent and children (it quickly becomes erratic and introduces more things that may go wrong)
- Somehow, wrap up the spawning process with a timeout parameter - but this is a stupid approach, because if the child does intensive work, the parent may incorrectly think that the child is dead.
What are the best practices for letting parents know that a child is dead?
[edit]
BTW, I develop / run / deploy on Linux