Boost logo

Boost Users :

Subject: Re: [Boost-users] [Asio] Handlers of asycn_send_to are called in which order?
From: Cesar Mello (cmello_at_[hidden])
Date: 2015-01-30 15:56:31


Hi,

You need to chain the second call in the continuation handler of the first.
There are several ways to do this, I found this paper useful to understand
the options and the way it works:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4045.pdf

And you should read the documentation and the examples:

http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio.html

http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/examples/cpp11_examples.html

I hope it helps. I am still learning the basics, but the coroutine is my
favorite by now.

Best regards
Cesar

On Wed, Jan 28, 2015 at 2:29 PM, Attila Rajmund Nohl <
attila.r.nohl_at_[hidden]> wrote:

> Hello!
>
> My code sends UDP packets using async_send_to. If all packets are
> successfully sent, are their handlers called in the same order as the
> async_send_to calls happened? I mean if my code looks something like
> this:
>
> socket.async_send_to(buffer1, destination, handler1);
> socket.async_send_to(buffer2, destination, handler2);
>
> Is it guaranteed that handler2 is always called after handler1?
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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