Boost logo

Boost Users :

Subject: Re: [Boost-users] asio UDP message packet loss even on localhost?
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-10-22 10:36:54


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net