C# Class winsw.Util.SigIntHelper

Exibir arquivo Open project: kohsuke/winsw Class Usage Examples

Public Methods

Method Description
SendSIGINTToProcess ( Process process, System.TimeSpan shutdownTimeout ) : bool

Uses the native funciton "AttachConsole" to attach the thread to the executing process to try to trigger a CTRL_C event (SIGINT). If the application doesn't honor the event and shut down gracefully, the. wait period will time out after 15 seconds.

Private Methods

Method Description
AttachConsole ( uint dwProcessId ) : bool
FreeConsole ( ) : bool
GenerateConsoleCtrlEvent ( CtrlTypes dwCtrlEvent, uint dwProcessGroupId ) : bool
SetConsoleCtrlHandler ( ConsoleCtrlDelegate HandlerRoutine, bool Add ) : bool

Method Details

SendSIGINTToProcess() public static method

Uses the native funciton "AttachConsole" to attach the thread to the executing process to try to trigger a CTRL_C event (SIGINT). If the application doesn't honor the event and shut down gracefully, the. wait period will time out after 15 seconds.
public static SendSIGINTToProcess ( Process process, System.TimeSpan shutdownTimeout ) : bool
process System.Diagnostics.Process The process to attach to and send the SIGINT
shutdownTimeout System.TimeSpan
return bool