Boost logo

Boost Users :

Subject: Re: [Boost-users] Multiple async operations on a socket
From: Roman Shmelev (rshmelev_at_[hidden])
Date: 2009-09-16 15:11:19


> I have a boost::asio::ip::tcp::socket that I want to write to.   Can I
> have multiple outstanding async_write() requests for a single socket?
> Are the writes performed in the order in which they are submitted?  Or
> is this undefined behavior?
>
> How about multiple async_read() requests on the same socket?

Do not do multiple. Make your own simple queue for each connection and be happy.
I'm acquainted with this problem and got quite bad behavior when using
multiple async_write's at once.

Of course, you still can run async_read and async_write together for
one connection.

Of course, you still can run multiple async_read's, async_write's,
when you have multiple connections.

Hope this helps.
BTW, you can find in boost archives two discussions on similar topic.


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