I am currently working on pipes and using pipes to make a child and parent process communicate with each other. I have it now for it to send a message to the child but I don't know how to make the child process respond to it. Not sure how I would do it and if anyone could find a webpage that is good for learning pipes in general, please link it if possible. Thank you.
Asked
Active
Viewed 84 times
1 Answers
1
For two-way communication you basically want to have 2 sets of pipes.
Please find more detailled information in:
glibc manual: https://www.gnu.org/software/libc/manual/html_node/Pipes-and-FIFOs.html#Pipes-and-FIFOs
Using pipe to pass integer values between parent and child
- the second example of the approved answer shows two-way communication you are looking for
of course
man 2 pipe
andman fork
as well

kongo2002
- 1,006
- 5
- 11
-
Is there any way you can show me code with 2 sets of pipes? I can't seem to understand what I need to do here. – James Williams Oct 25 '18 at 08:41
-
@JamesWilliams Please have a look at the second example in the accepted answer - there is an example of a two-way communication using two pipe tuples. – kongo2002 Oct 25 '18 at 09:19