I have a question regarding how to create the following system:
My system is built from several clients who listen to the environment. When the sound threshold is violated, they send their information to a server that has children who listen to each connection. To perform the necessary calculations, the server requires information from all clients.
Currently, the server runs on UNIX and has branched connections. They work independently.
What I want to do is tell the parent (on the server) that the information has been sent, and now it's time to process it. How am I supposed to do this?
I am thinking about possible ways to do this:
- Using
signal() on Unix to somehow tell parents that something happened - Convert to streams and use some waiting and notification features
A signal is preferable, but I cannot figure out how to do this efficiently. Because the following may happen on my system:
- If all clients have successfully sent information to their child servers, how can I tell my parents that I am ready in efficient mode? I don't know / I'm not sure how he will handle them.
- The server may not receive information from all clients. Therefore, the parent should wait for some time for all children, but not too long. So, I guess some kind of timer?
c design fork sockets tcp
Mazze
source share