in reply to Flaky Server (IO::Socket and IO::Select Question)
I'm not even close to the level where I can answer this yet but one statement caught my interest.
"In fairness I should note that this entry does make it into the log, about 8 minutes after the link fails"I recently was browsing Brother Dominus's tome on "Suffering from Buffering" and that statement seem like it might be a like problem. On the off chance it does correlate, I though I'd mention it.
In Perl, you can't turn the buffering off, but you can get the same benefits by making the filehandle hot. Whenever you print to a hot filehandle, Perl flushes the buffer immediately. In our log file example, it will flush the buffer every time you write another line to the log file, so the log file will always be up-to-date.
[snip]If you happen to be using the FileHandle or IO modules, there's a nicer way to write this:
use FileHandle; # Or `IO::Handle' or `IO::'-anything-else ... LOG->autoflush(1); # Make LOG hot. ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Flaky Server (IO::Socket and IO::Select Question)
by ginseng (Pilgrim) on Jun 13, 2001 at 01:13 UTC |