in reply to forking server
I think part of the difficulty is that you have the parent communication bit in the child bits of make_new_child(). I'd expect to see that rather in the parent part.
I'm not a socket guru, so I don't know if storing the results of an accept() call that way will work. Since you're using the same socket on the parent side, I'd expect you can only talk to one kid at a time, and that only if the kid has made a connection to the parent.
merlyn has an example of a preforking chat server on his web page. It's WebTechniques column 22 or 23, I believe. Examining that code and the explanation may be more helpful in this case.
|
|---|