Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CTRL_CLOSE_EVENT #2

@judwhite

Description

@judwhite

Here's how to catch CTRL_CLOSE_EVENT in Windows (end task or close console window). There was some effort to translate this to SIGTERM but requires blocking which isn't compatible with the signal.Notify model.

The right way to stop a service would be sc stop or net stop and I believe these stop signals are sent during reboot/shutdown, I'll have to double check. If they are this is probably just "interesting" and adding this would help in the case of someone killing the process instead of stopping the service gracefully.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions