Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm in charge an application daemon which must handle
logoff event.
The sample script is:
use strict; use Win32::API; # sub catch { my $signame = shift; die "bye...\n"; } # my $func = "\&catch"; # my $Con_Event = new Win32::API('kernel32', 'SetConsoleCtrlHandler', 'P +I', 'N'); # if (!$Con_Event) { exit; } my $return = $Con_Event->Call($func, 1); if (!$return) { exit; } # loop for test only for (;;) { }
When in test the system crash and I must reboot.
What's wrong?
Thanks in Advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SetConsoleCtrlHandler Script
by BrowserUk (Patriarch) on Mar 08, 2004 at 18:17 UTC | |
by Anonymous Monk on Mar 08, 2004 at 20:54 UTC | |
by BrowserUk (Patriarch) on Mar 08, 2004 at 21:15 UTC | |
by Anonymous Monk on Mar 09, 2004 at 18:49 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2004 at 22:08 UTC | |
|
Re: SetConsoleCtrlHandler Script
by CombatSquirrel (Hermit) on Mar 08, 2004 at 15:51 UTC |