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

Skip to content

How to shutdown the dir_monitor object in order to allow the io_service to exit the .run loop? #47

@jdmairs

Description

@jdmairs

If you take the example test program test_running.cpp and add a asio/signal_set handler to trap Ctrl-C there doesn't appear to be a way to remove the async_monitor operation thus io_service.run() never exits.

In my application our Ctrl-C handler gracefully tells all asio io_objects (timers, sockets) to "shutdown". Then the io_service exits once all the handlers have executed and the program drops out of the bottom of main.

Even calling remove_directory in the Ctrl-C handler appears to keep the work on the queue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions