|
Boost Users : |
Subject: Re: [Boost-users] [asio] multiple simultaneous async_read calls
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-08-11 09:10:31
On 11 Aug 2014 at 8:56, Lee Clagett wrote:
> > I'd ask a simpler question: what use case is there for configuring
> > multiple concurrent async reads on the same stream?
> >
> > On *files*, yes this makes sense. But on sockets/pipes etc, the use
> > cases are not many (possibly with UDP yes, otherwise no).
> >
> If you want to queue up multiple reads at a time (data to different
> buffers), having the framework handle it (ASIO or OS) is easier than
> writing that portion yourself.
ASIO (and AFIO) already provides scatter-gather i/o to do just this.
Both call the appropriate OS facilities where those are available.
See
http://www.boost.org/doc/libs/1_56_0/doc/html/boost_asio/overview/core
/buffers.html.
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
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