Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: bidirectional IPC (Linux)

by traveler (Parson)
on Nov 07, 2001 at 23:48 UTC ( [id://123906] : note . print w/replies, xml ) Need Help??


in reply to Re: Re: bidirectional IPC (Linux)
in thread bidirectional IPC (Linux)

but I have to have two pipes to each child, don't I?

Yes. If you want to follow the rules and if you are sending data bidirectionally. Or you can use a socket. Sockets are bidirectional and work very much like pipes once established.

thats right, this wont work...

I'm not sure what you mean by this.

Select is then a method without fork, but I haven't understood it completely, what does the Select do, it determines from which socket 'data comes in', and then reads it?

No. select tells you when a filehandle is ready for reading or writing or when it has an error condition. You need to do the I/O yourself. It can be used with or without fork.

While the implementation of threads, and maybe the syntax may change, using threads may still be your best bet.

HTH, --traveler

Replies are listed 'Best First'.
Re: Re: Re: Re: bidirectional IPC (Linux)
by Mirage (Sexton) on Nov 09, 2001 at 02:54 UTC
    >I'm not sure what you mean by this.

    it simply means youre right, i can't send to all clients at
    once, or better i dont want to because it mostly senseless.

    >No. select tells you when a filehandle is ready for reading or writing or when it has an error condition. You need to do the I/O yourself. It
    >can be used with or without fork.

    this means, I still have to fork, and then do the IPC stuff, right?
    Maybe i really should consider threads, because i think
    using two pipes, with two extra child for each child,
    i have too much childs at the, especially if the amount of
    connections is on a normal level of 20, i would have 60
    processes, way too much...

    Thanks so far