Re: socketpair - problem communicating to multiple subprocesses
- From: jan.mach@xxxxxxxxx (Honza Mach)
- Date: Mon, 06 Jun 2011 12:35:19 +0200
Thank you for your help.
Regards
Honza Mach
On Sun, 2011-06-05 at 13:09 -0400, Uri Guttman wrote:
"HM" == Honza Mach <jan.mach@xxxxxxxxx> 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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
- References:
- socketpair - problem communicating to multiple subprocesses
- From: Honza Mach
- Re: socketpair - problem communicating to multiple subprocesses
- From: "Uri Guttman"
- socketpair - problem communicating to multiple subprocesses
- Prev by Date: fastq file modification help
- Next by Date: Re: fastq file modification help
- Previous by thread: Re: socketpair - problem communicating to multiple subprocesses
- Next by thread: Re: socketpair - problem communicating to multiple subprocesses
- Index(es):
Relevant Pages
|