As you can see here in this example UDP server, the run method will keep the application running forever. (tested)
So there is no need to use the work class as mentioned in the documentation
From boost documentation:
The work class is used to inform the io_service
when work starts and finishes. This ensures that the io_service
object's run()
function will not exit while work is underway, and that it does exit when there is no unfinished work remaining.