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@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Igor R Sent: Thursday, July 23, 2009 9:41 AM To: boost-users@lists.boost.org 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users