Re: anonymous pipes



You are probably better off using sockets unless you have some compelling reason to use pipes.

harshalshete@xxxxxxxxx wrote:
hi group,

i am very new to mfc. and trying to communicate via ipc with the child
process.
but some things i didnot understand after reading the documents.


1) redirecting input and output of the child process i have to use two
pipes
--because it anonymous pipe is only one directional so that for data
to child process one pipe
--and for data from child process another pipe.(understood)

2)the child process inherits the handles so before creating child
process make duplicate copies of that hadle.(i didn't got this
point.)from what i read they say that child should not inherit that
handle.

3)
and actually i am to send the data to child and then able to get his
reply depending on that data for only one time.
if i want to do this untill some event then how i can do this?
means if
parent say's "hello child" then child should respond "hello
parent"
then if parent say's "help" then child "result"
like this untill parent says stop then child will get killed.
so for doing this do i need to handle synchronization?

4)and after every writefile do i need to make a call to CloseHandle();
and if i closed the handle then how i will communicate with child next
time

5) general architecture i want to develope

parent
child


p1

------------------------------------------------------->



p2

<----------------------------------------------------------

architecture

parent
child
step in

--------------------------------------------------------->
respective result

<---------------------------------------------------------


step out

----------------------------------------------------------->
respective result

<---------------------------------------------------------


stop

---------------------------------------------------------------->

will end



(main thing i want to do is that parent should be able to send request
multiple times and then child should respond multiple times)

how to do it?can i do it without threading?
please suggest a good method because i am doing IPC for first time.


Regards &Thanks
Harshal shete

.



Relevant Pages

  • Re: forking in c
    ... the very last child it prints out says it has a parent id ... each child process should have a child process of their own. ... The next statement the child executes is ...
    (comp.unix.programmer)
  • Re: Basic Inter process communication question
    ... I have some general questions about UNIX/Solaris IPC. ... child process and the wait for the child process to complete. ... The twist is that I don¹t want the memory of the parent process to be ...
    (comp.unix.programmer)
  • Re: problem with WaitForSingleObject on WM5
    ... signaled after child exit and it wait for long until new child create. ... BTW is there other way for parent process to know about child exit? ... I want to wait for child process shutdown, ...
    (microsoft.public.windowsce.embedded)
  • Re: Blocking system calls, and pthreads
    ... > Maybe it's just easier than forking and having a child process ... > that has all heap allocations and open files from the parent, ... > be used by the child. ...
    (comp.unix.programmer)
  • Re: anonymous pipes
    ... redirecting input and output of the child process i have to use two ... parent say's "hello child" then child should respond "hello ... multiple times and then child should respond multiple times) ...
    (microsoft.public.vc.mfc)