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-17 23:07:18


Thanks Matheus, thats very slick, works well.

________________________________

        From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Matheus Araújo Aguiar
        Sent: Friday, July 17, 2009 8:16 PM
        To: boost-users_at_[hidden]
        Subject: Re: [Boost-users] Using boost::asio::async_write to stream out data
        
        

        On Fri, Jul 17, 2009 at 8:32 PM, Alex Black <alex_at_[hidden]> wrote:
        

                So, If I'm calling aysnc_write from the same thread each time, and I'm not waiting for previous writes to complete before starting a new write, how do I know when to free my buffer?
                 
                The problem seems to be that the handle_write method will be called to let me know when the write is complete, but I won't have any information in handle_write to know *which* buffer to free... any suggestions?
                 
                thx
                 
                - Alex

        you could pass the pointer to the buffer as an argument of the "handle_write method".
        
        Best Regards,
        --
        
        Matheus Araújo Aguiar
        Computer Scientist
        matheus.pit_at_[hidden]
        



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