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:ComposedConnectHandler Composed connect handler requirements]
10 A composed connect handler must meet the requirements for a [link
11 boost_asio.reference.Handler handler]. A value `h` of a composed connect 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 the type `Iterator`
14 used in the corresponding `connect()` or async_connect()` function.
18 A free function as a composed connect handler:
21 const boost::system::error_code& ec,
22 boost::asio::ip::tcp::resolver::iterator iterator)
27 A composed connect handler function object:
29 struct connect_handler
32 template <typename Iterator>
34 const boost::system::error_code& ec,
42 A non-static class member function adapted to a composed connect handler using `bind()`:
44 void my_class::connect_handler(
45 const boost::system::error_code& ec,
46 boost::asio::ip::tcp::resolver::iterator iterator)
51 boost::asio::async_connect(...,
52 boost::bind(&my_class::connect_handler,
53 this, boost::asio::placeholders::error,
54 boost::asio::placeholders::iterator));