I implemented async_connect
successfully using it as a free function and a lambda as connect_handler as follows:
auto self(shared_from_this());
boost::asio::async_connect(m_socket, endpoint_iter, [this, self](boost::system::error_code ec, tcp::resolver::iterator){...}
However, now I'm forced to use the no_delay
flag. Regarding this entry boost::asio with no_delay not possible? I have to call async_connect as member function of the socket. Trying as following
m_socket.async_connect(endpoint_iter->endpoint(), [this, self](boost::system::error_code ec, tcp::resolver::iterator){...}
my compiler (VS2013) gives me an error Error 1 error C2338: ConnectHandler type requirements not met
Does someone has as idea, how to do it correctly?