
Rutger,
Not sure if it's related to your problem, but AFAICT you are not managing your resources in a correct way. Everything passed to an 'async_' function should outlive the full async operation. E.g., in your 'send' function you use a RValue string -- this will most probably not outlive the async_send_to operation.
thanks for the observation. as stated in an earlier e-mail, this code comes from this sample: http://www.boost.org/doc/libs/1_44_0/doc/html/boost_asio/example/echo/async_...
Perhaps related to your problem, is that you are counting the number of "received_from" callbacks, not the number of received messages. Couldn't it be that you receive multiple messages in one callback?
my presumption would be that this is called each time a message is received. also, when saving & printing out these messages, it is clear that messages are received exactly as they are sent. Akos