Greetings,
I have a program that accepts socket connections with IO::Socket (or rather its subclass HTTP::Daemon). Because this program is also checking for user input, I'm using a timeout on the accept call. But it appears that the minimum timeout is 1 second. In the interest of responsiveness to picky users, I'd like to make it shorter if I could (maybe 0.25 or 0.5 sec). Is there a way to do this, or some creative workaround I could employ instead? My current code looks roughly like:
I'm running on Win32 ActivePerl 5.8.6 in case it matters.my $d = HTTP::Daemon->new ( LocalAddr => 'localhost', LocalPort => 1244 ) or die; $d->timeout(1); MAIN_LOOP: while (1) { my $c = $d->accept; unless (defined $c) { do_other_stuff(); next MAIN_LOOP; } process_request($c); }
Update: I am on crack. saintmike is correct. I don't know why I thought otherwise (or why I didn't retest one last time). saintmike++.
In reply to short (<1sec) timeout on IO::Socket by Errto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |