[EMAIL PROTECTED] wrote:
> Hallo all
>
> I have:
> Windows NT and Windows 2000
> with Perl 5.6.1 build 635
>
> I want:
> watch a child:
> - I make this child
> - the child give Information to his parent every 10 seconds
> - the parent is waiting for maximal 15 seconds (non blocking)
> - if not information from child the parent can do anything
>
> I have a solution over a file and need a direct way
>
> I have tested:
> - with SIG --> the kill not send a signal - the kill end the parent
> - with select ($a=$b,undef,undef,0) --> blocking until the child print
> - with select ($a=$b,undef,undef,15) --> blocking until the child print
> - with IO::Select --> the @ready = $s->can_read(15) blocking until the
> child print
> - with read --> blocking until the buffer is full
> - with sysread --> blocking until the buffer is full
> - with sysopen --> the O_NONBLOCK is not available
> - with Fcntl --> Your vendor has not defined Fcntl macro O_NONBLOCK
>
> Do I have a Chance to do which I want ?????????????????????????????
Select only works on sockets in Windoze.
Most signals do not work in Windoze (a couple are faked).
You could use a file or sockets to pass the info.
> - snip ----------------
> parent:
> my $proc = open (RD,"perl child.PL $$|");
> vec($AnfMask, fileno (RD), 1) = 1;
> while 1 {
> select ($ErgMask = $AnfMask , undef , undef , 15 );
> if (vec($ErgMask,fileno (RD), 1)){
> # The child lives and is active
> @a=<RD>
> # If it enough is kills the child and last
> }else{
> # child is not active --> if the child is present, kill it
> # start the child again
> }
> }
> child:#
> while 1 {
> # do anything
> print STDOUT "blabla";
> select (undef, undef, undef , 10) # wait 10 seconds
> }
> - end snip ----------------
--
,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED]
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs