in reply to Re^3: Does IO::Select work? Anywhere?
in thread Does IO::Select work? Anywhere?
that is why I like using the eventloop method that Glib and Wx use
I guess it explains the popularity of such frameworks, when the primary perl tool -- IO:Select -- has been broken for 12 years or more.
And probably why all the examples are so bare bones. Every time anyone has tried to write anything more complex, it breaks. So they either give up or resort to some higher-level framework.
P.S. See the low level Perl code, multiplexing server at perl examples
Thanks. Unfortunately, the first thing I see in the I/O Multiplexing Server example is:
sub readline { # 'select'-compatible function for reading one line of input from # a filehandle. # # readline() expects one argument -- filehandle S # # sample call: $mystring = readline('S') # my $filehandle = $_[0]; my $c=''; my $retstr=''; my $endoffile=0; while ($c ne "\n" && ! $endoffile) { if (sysread($filehandle, $c, 1) > 0) { $retstr = $retstr . $c; } else { $endoffile=1; } } return $retstr; }
What if the client gets interrupted before it sends the newline?
You've got a something like 900 seconds default before the connection times out and the endoffile flag gets raised; during which time, nothing else happens. No new clients get accepted, no existing clients get serviced.
And this is teaching material??
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Does IO::Select work? Anywhere?
by zentara (Cardinal) on Oct 22, 2012 at 10:35 UTC | |
by BrowserUk (Patriarch) on Oct 22, 2012 at 17:54 UTC | |
by zentara (Cardinal) on Oct 23, 2012 at 10:01 UTC | |
by BrowserUk (Patriarch) on Oct 23, 2012 at 10:47 UTC | |
by zentara (Cardinal) on Oct 23, 2012 at 14:23 UTC | |
|