in reply to Re: chargen program is too slow / IO::Select socket handle outputting timing issue
in thread chargen program is too slow / IO::Select socket handle outputting timing issue
I think part of the problem is the slightly awkward syntax of the IO::Select->select($sel, $sel); and the fact that there is no example of this call in IO::Select's docs.
I think it would make a lot of sense to have a method like this:
or maybe even bettermy ($rready, $wready) = $sel->can([TIMEOUT]);
Looking at the code in IO::Select.pm it seems to me the only change necessary would be on lines 181-184:my ($rready, $wready) = $sel->select([TIMEOUT]);
the question is whether anyone would notice that $sel->select() not longer means IO::Select->select($sel) but rather IO::Select->select($sel,$sel,$sel)- shift - if defined $_[0] && !ref($_[0]); - - my($r,$w,$e,$t) = @_; + my($r,$w,$e,$t); + if (defined $_[0] && !ref($_[0])) { # called as a static method + shift; + ($r,$w,$e,$t) = @_; + } elsif (@_ == 1 || @_ == 2 && !ref($_[1])) { # called as $sel->sele +ct() or $sel->select($timeout) + $r=$w=$e=$_[0]; + $t=$_[1]; + } else { # called as IO::Select::select(...) + ($r,$w,$e,$t) = @_; + }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: chargen program is too slow / IO::Select socket handle outputting timing issue
by ikegami (Patriarch) on Jul 14, 2006 at 14:51 UTC |