2 / Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 [section:ResolveHandler Resolve handler requirements]
10 A resolve handler must meet the requirements for a [link
11 boost_asio.reference.Handler handler]. A value `h` of a resolve handler
12 class should work correctly in the expression `h(ec, i)`, where `ec` is an
13 lvalue of type `const error_code` and `i` is an lvalue of type `const
14 ip::basic_resolver_iterator<InternetProtocol>`. `InternetProtocol` is the
15 template parameter of the [link boost_asio.reference.ip__resolver_service
16 `resolver_service`] which is used to initiate the asynchronous operation.
20 A free function as a resolve handler:
23 const boost::system::error_code& ec,
24 boost::asio::ip::tcp::resolver::iterator iterator)
29 A resolve handler function object:
31 struct resolve_handler
35 const boost::system::error_code& ec,
36 boost::asio::ip::tcp::resolver::iterator iterator)
43 A non-static class member function adapted to a resolve handler using `bind()`:
45 void my_class::resolve_handler(
46 const boost::system::error_code& ec,
47 boost::asio::ip::tcp::resolver::iterator iterator)
52 resolver.async_resolve(...,
53 boost::bind(&my_class::resolve_handler,
54 this, boost::asio::placeholders::error,
55 boost::asio::placeholders::iterator));