in reply to Re^8: Does IO::Select work? Anywhere?
in thread Does IO::Select work? Anywhere?
Even though you denigrated the earlier good professor's code of sysreading 1 byte at a time, in Re^4: Does IO::Select work? Anywhere?
maybe therin lies your answer?while ($c ne "\n" && ! $endoffile) { if (sysread($filehandle, $c, 1) > 0) { $retstr = $retstr . $c; } else { $endoffile=1; } }
The intuitive side of my brain points you to IPC3 buffer limit problem, where you can use syscntl statements. Merlyn says it's effective, except for one case. :-) So I figure, what are the odds? The odds that the last buffer is exactly 4k? 1 in 4k ? Pretty good odds. :-) But then again, I don't fly spaceships either. :)
P.S. I tried your hanging script on the server in Glib based forking server with root messaging and the server handled it just fine. It continued reading messages from clients, and accepted new clients. Sometimes, you just have to learn to use modules instead of reinventing the conveyor belt.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Does IO::Select work? Anywhere?
by BrowserUk (Patriarch) on Oct 23, 2012 at 20:50 UTC | |
by zentara (Cardinal) on Oct 24, 2012 at 11:15 UTC |