zzspectrez has asked for the wisdom of the Perl Monks concerning the following question:
Im curious if anyone has sucessfully used IO::Select on windows. I am trying to use it in some network code. I have been unable to get it to work. I thought I was doing something wrong since I havent used this module before. After messing with this all day today I got the idea to try it on my linux box, and it works fine. So now Im at a loss about what to do now. Basicly, on my win2k machine the loop immediately exits and the program closes. On my linux box, it loops through excepting keyboard data and quits on typing /quit.
If the module can not be made to work..... Is there another way I can get similar functionality??
Here is sniplet of the code.
sub MainLoop { my $self = shift; my $in = \*STDIN; my $net = $self->{'sock'}; my $sel = IO::Select->new($in); $sel->add($net); my @ready = (); DD: while(@ready = $sel->can_read) { foreach my $fh (@ready) { if ($fh == $in) { my $dat = <$fh>; chomp $dat; last DD if ($dat eq '/quit'); }elsif ($fh == $net) { } } } $self->logoff; close $self->{'sock'}; }
Thanks!
zzSPECTREz
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: IO::Select on Windows
by MeowChow (Vicar) on Dec 11, 2000 at 13:54 UTC | |
Re: IO::Select on Windows
by Fastolfe (Vicar) on Dec 11, 2000 at 18:52 UTC | |
by zzspectrez (Hermit) on Dec 18, 2000 at 23:05 UTC | |
Re: IO::Select on Windows
by a (Friar) on Dec 11, 2000 at 10:23 UTC | |
Re: IO::Select on Windows
by gharris (Beadle) on Dec 11, 2000 at 21:34 UTC |