Boost logo

Boost Users :

Subject: Re: [Boost-users] asio async_write bad address error
From: Igor R (boost.lists_at_[hidden])
Date: 2009-07-19 10:33:06


> Yes, I see, but making buffers a member of TcpConnection class doesn't
> resolve the problem.

By saying "buffers" you mean the vector that you pass to
async_write()? It's not necessary to make this object the member, as
it's passed by value anyway. What I mean is that the *data* you send
must outlive the whole async. write process, and your data resides in
outboundData & outboundHeader local std::string's. Asio::buffer
wrapper is just an adaper, it doesn't copy any underlying data.


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