Hi,
     I am modifying example echo server for my server.
I started to get the attached error, and I suspect I am using buffer incorrectly since error started after a change there.

I just changed a line from

boost::asio::async_write(socket_,
              boost::asio::buffer("1^", 3,
              boost::bind(&session::handle_write, this,
                boost::asio::placeholders::error));

to

boost::asio::async_write(socket_,
              boost::asio::buffer(replyString, replyString.size()),
              boost::bind(&session::handle_write, this,
                boost::asio::placeholders::error));

I generate the replyString to have results from my database query separated with ^ signs (which is used to tokenize the replyString on the client side...)

            string replyString="1^";
            while(res->next())
            {
                replyString+=res->getString("nickname")+"^";
            }

I checked that replyString.size() is really one more than the final filled position index in replyString.
Any ideas, suggestions?
TIA,
Best regards,
Ozgur (Oscar) Ozturk
www.DrOzturk.com
Phone: +1 (908) DROZGUR
i.e,        +1 (908) 376-9487