9 #ifndef CPPSERVER_ASIO_TCP_RESOLVER_H
10 #define CPPSERVER_ASIO_TCP_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::tcp::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::tcp::resolver _resolver;
TCPResolver(const TCPResolver &)=delete
TCPResolver(TCPResolver &&)=delete
asio::ip::tcp::resolver & resolver() noexcept
Get the TCP resolver.
std::shared_ptr< asio::io_service > & io_service() noexcept
Get the Asio IO service.
TCPResolver & operator=(TCPResolver &&)=delete
asio::io_service::strand & strand() noexcept
Get the Asio service strand for serialized handler execution.
TCPResolver & operator=(const TCPResolver &)=delete
std::shared_ptr< Service > & service() noexcept
Get the Asio service.
TCPResolver(const std::shared_ptr< Service > &service)
Initialize resolver with a given Asio service.
virtual void Cancel()
Cancel any asynchronous operations that are waiting on the resolver.
C++ Server project definitions.