9 #ifndef CPPSERVER_ASIO_UDP_RESOLVER_H
10 #define CPPSERVER_ASIO_UDP_RESOLVER_H
39 std::shared_ptr<Service>&
service() noexcept {
return _service; }
41 std::shared_ptr<asio::io_service>&
io_service() noexcept {
return _io_service; }
43 asio::io_service::strand&
strand() noexcept {
return _strand; }
45 asio::ip::udp::resolver&
resolver() noexcept {
return _resolver; }
48 virtual void Cancel() { _resolver.cancel(); }
52 std::shared_ptr<Service> _service;
54 std::shared_ptr<asio::io_service> _io_service;
56 asio::io_service::strand _strand;
57 bool _strand_required;
59 asio::ip::udp::resolver _resolver;
virtual void Cancel()
Cancel any asynchronous operations that are waiting on the resolver.
std::shared_ptr< asio::io_service > & io_service() noexcept
Get the Asio IO service.
UDPResolver(const std::shared_ptr< Service > &service)
Initialize resolver with a given Asio service.
UDPResolver & operator=(const UDPResolver &)=delete
asio::ip::udp::resolver & resolver() noexcept
Get the UDP resolver.
UDPResolver & operator=(UDPResolver &&)=delete
UDPResolver(UDPResolver &&)=delete
std::shared_ptr< Service > & service() noexcept
Get the Asio service.
UDPResolver(const UDPResolver &)=delete
asio::io_service::strand & strand() noexcept
Get the Asio service strand for serialized handler execution.
C++ Server project definitions.