Boost logo

Boost Users :

Subject: Re: [Boost-users] asio async_write bad address error
From: Thomas Klein (tma.klein_at_[hidden])
Date: 2009-07-19 04:13:05


On 18 juil. 09, at 19:47, Igor R wrote:

>> Here is a tgz of a code sample : http://archon.adept.free.fr/asioproblem.tgz
>> In the archive you'll find a server and a client directory. in each
>> directory you'll find a compile.sh file you'll have to adapt to your
>> configuration.
>> In the file asiotestserver/TcpConnection.cpp line 131 you''ll find
>> a comment
>> explaining the transfer problem.
>
> At a glance, it seems that in TcpConnection::SendInfo() you try to
> send *local* buffers asynchronously. Is it really what you're doing,
> or I'm missing something?

I got it !

boost::asio::buffer don't make copy of the object "pushed" in it.

In this case, a solution is to put outboundHeader and outboundData
members of the TcpConnection class.

For multiple simultaneous call, I'll manage the data in a singleton.

Thanks a lot for the feedback.



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