Thomas T. Veldhouse writes:
> Why is that?  It is much easier to differentiate between senders if
> you use sockets rather than pipes.  There are other types than
> TCP sockets that would work in thiis case (i.e. Unix sockets).

Sockets can be created via socket() or socketpair().  The latter provides no
way to differentiate between senders.  Using sockets, the two most portable
methods are Unix domain sockets and internet sockets.

Unix domain sockets require a name to be created on the filesystem.  The OP
stated that he did not want to use a temporary file, so it is likely he did
not want to use the filesystem at all.  This might be due to permission
issues, name conflicts (multiple instances of the program), etc.

Internet sockets require binding to an IP address and port.  Choosing a
unique port number could be problematic if there are multiple instances of
the program.  Each child would need to be identified either by the IPC
protocol or via the port it is connecting from.  The latter requires
connecting the sockets before forking and closing all the extra descriptors.

If you simply want to differentiate by using extra file descriptors, then
using multiple pipes or socket pairs would be easiest.  Care must be taken
to close extra file descriptors in each child.

-- 
David Phillips <david at acz.org>
http://david.acz.org/


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
Help beta test TCLUG's potential new home: http://plone.mn-linux.org
Got pictures for TCLUG? Beta test http://plone.mn-linux.org/gallery
tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list