>>>>> "HM" == Honza Mach <jan.m...@cesnet.cz> writes:

  HM> my ($child, $parent);

  HM> foreach my $i (1..3)
  HM> {
  HM>   socketpair($child, $parent, AF_UNIX, SOCK_STREAM, PF_UNSPEC)
  HM>           or die "socketpair: $!";

you are using the same variables to store each socketpair in the
loop. so that will close the previous sockets and open up new ones. you
need to keep them in a hash like you do with the pids (in the
parent). then you can communicate with a unique socket to each child. of
course in the child you can keep using these vars as they only need to
track the single socket to the parent.

and there are modules that do most of this for you. see if one of them
is right for you.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to