It's the first time I use lambda functions in C++ and I need to pass a value to use inside the body of a lambda function:
in the code above I need to pass int parameter seq_msg:
void do_connect(tcp::resolver::iterator endpoint_iterator, int seq_msg)
{
boost::asio::async_connect(socket_, endpoint_iterator, [this](boost::system::error_code ec, tcp::resolver::iterator)
{
if (!ec)
{
send_message(seq_msg);
do_read_header();
}
});
}