I am using boost::asio::ip::udp::resolver in an SNMPV2 implementation to determine wheather a host is reachable or not.
using Resolver = boost::asio::ip::udp
What you need are two io_service ioService, because each one is run by a thread. By that I mean that you block the normal execution of a thread by calling io_service::run.
io_service ioService
io_service::run
I think that the code itself is correct.