On Dec 28, 2003, at 2:57 AM, Artem Koutchine wrote: [..]
In order not to waste CPU time and have server do
something usufull (like calculating something) i tried
handling SIGIO, so, when data is available on incoming
connection i handle and when there is no data, server
does its own job. However, it figures, that when  i added
 fcntl(STDIN, F_SETFL, O_ASYNC|O_NONBLOCK);
sleep(5) stopped working right. It does not wait for 5 seconds
any longer, but actually for about 1/3 second and fully ignores
the sleep time a specify (you can run the server and connect to
it using telnet and see for yourself). I could not find any info
on sleep (SIGALRM) messing with SIGIO and O_ASYNC
mode. Any ideas what's going on and how to fix this?
[..]

this sounds like one of the 'bugs' in perl 5.8.0 and/or 5.8.1
that is suppose to be fixed in 5.8.2 - One strategy would
be to create a SIGALRM handler that would set a flag value
you could check to see if your alarm went off and was handled.


ciao drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to