Fork and exec

Hello!
I am working on a server where I should have 4 (resident)processes, one of them being "the father" of the others, so I do 3 forks. The problem that I have is that I do an accept (for sockets) in the "father" process and I want to transmit the job to one of the processes "child" with anonymous pipes. In this case should I do a connection from "the child" processes to the client in order to deliver him the response? I use this technique, but "the child" sometimes is able to connect back to the client and sometimes not. I don't understand why? Any other suggestion is highly welcomed.

Regards

Perhaps it is a synchronization issue, maybe the child processes need to wait a little bit before attempting to connect.

But honestly, I am not sure if I understand the question. Perhaps, you want to write it in more distinct steps with the syntax of what you are doing to make it easier for everyone to understand and help you ?

Thanks.

Exactly. I've added a sleep command and now it's ok.
Thank you for your explanation.

Regards

you could rather go for the wait command than going for the sleep command... i think tht would be more useful and helpful:)