Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::asio::async_write to stream out data
From: Alex Black (alex_at_[hidden])
Date: 2009-07-23 09:47:34


So, doing this is not allowed:

async_write( socket, ... );
async_write( socket, ... );

Instead, I have to queue the 2nd buffer until the first write is done?

> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Igor R
> Sent: Thursday, July 23, 2009 9:41 AM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] Using boost::asio::async_write to
> stream out data
>
> > I'm not 100% clear on this yet, is it safe for my thread to call
> > async_write over and over again without waiting for
> previous writes to complete?
> >
> > Is it safe to do this on two different threads writing each out on
> > their own socket?
>
> It's safe to issue simultanious async_write's for different
> sockets and buffers. It's not safe to do this for the same
> socket, because
> async_write() does not guarantee that all the data is sent at once.
> _______________________________________________
> 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