in reply to Re: Re: flushing sockets
in thread flushing sockets

I don't know nothing about thread-programming in perl, but using fork I used a scheme like the folling:

eval { local $SIG{ALRM} = sub { die "Timed Out!\n" }; my $timeout = 30; # give 30 seconds to accept and process data my $previous_alarm = alarm($timeout); # get input # and do heavy and interesting and cool stuff :-) # ... # finished with this alarm($previous_alarm) }; # eval if ($@ =~ /timed out/i) { # check stuff, report error, etc }

hth

regards,
tomte


Edit:Fixed indentation.