Signals... SIGALRM
Milton Calnek
milton@calnek.com
Mon Jun 24 21:36:00 GMT 2002
Hello all.
I'm trying to write a UDP server program I would like to poll for UDP input
and periodically interupt the waiting to check the database. My primary
test environment is Cygwin.
I'm having trouble with SIGALRM not being sent/received. Specifically,
I want to read UDP packets but I don't want to be blocked waiting for
them. I am using IO::Socket.
I took this from the Perl Cookbook
if( eval {
local $SIG{ALRM} = \&poll_db;
alarm $config{TIMEOUT};
print STDERR "poll_udp(): Wait for input\n";
$sock->recv($input, $config{MAXLEN}) or die "poll_udp(): recv: $!";
alarm 0;
1; # return value from eval on normalcy
} ) {
and made a few modifications to it... it's from the udpmsg program 17.4 & 17.5
I read in the FAQ that not all signals are implemented... is SIGALRM one of those?
Is there a better way to do this?
Any help is apreciated.
TIA.
--
Milton Calnek
milton@calnek.com
Everything should be as simple as possible - but no simpler.
-- Albert Einstein as quoted by Peter G. Neumann in CHATS Principles
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list