If you check the reference for async_write
(all the overloads says the same on this subject) it will tell you that the handler function takes two arguments, first the error code and then the length of the sent data.
Your boost::bind
call only provides one argument. You still have to tell boost::bind
that there is an extra argument that will be filled in later. You do that with the placeholder argument, boost::asio::placeholders::bytes_transferred
:
So change it to e.g.
boost::bind(&StringSocket::MessageSent,
this,
asio::placeholders::error,
asio::placeholders::bytes_transferred)