
On 2010-10-22 10:37, Ákos Maróy wrote:
Hi,
I'm having a very basic issue: when sending a large number of UDP messages in short succession via boost::asio, even to localhost, after a few hundred messages, there seems to be a serious loss.
please see a sample code here: http://pastebin.com/Bq0DnkeG
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. 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? HtH, Rutger