I think the pipe file descriptor with index 1 fd[1] is used for write and fd[0] is used for read. If you don't close fd[0] in the read side, it will block. That's why your browser will waiting for response.<div>Further more, I don't think you need tow pipes. One is enough. You can just create one pipe in the parent process. Then you can use it to do communication between parent and child.</div>
<div>See the example in the Book.</div><div><br></div><div>Thanks</div><div>Chao</div><div><br><div class="gmail_quote">2012/12/16 hyan2 <span dir="ltr"><<a href="mailto:hyan2@stevens.edu" target="_blank">hyan2@stevens.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Professor,<br>
<br>
I use pipe for the communication between child process and parent process when I implement POST response. I use two pairs pipe but I find that I must close the other pipe to get the right result. For example, I have two pipe in the child process, one is fd1[2] and one is fd2[2], if I use fd1[0] and fd2[1], then I must close fd1[1] and fd2[0]. In the parent process, I use fd1[1] and fd2[0] and I must close its pairs. If I don't close those pairs I find my browser is waiting for result and when I terminate the server's process, the browser will get the right result. If I close those pairs, every thing is ok. I am confused about this. Could you explain this problem£¿<br>

<br>
Thank you.<br>
<br>
-Han<br>
______________________________<u></u>_________________<br>
cs631apue mailing list<br>
<a href="mailto:cs631apue@lists.stevens.edu" target="_blank">cs631apue@lists.stevens.edu</a><br>
<a href="https://lists.stevens.edu/cgi-bin/mailman/listinfo/cs631apue" target="_blank">https://lists.stevens.edu/cgi-<u></u>bin/mailman/listinfo/cs631apue</a><br>
</blockquote></div><br></div>