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?
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
>> 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?
Yes, I see, but making buffers a member of TcpConnection class doesn't
resolve the problem.
Here is a tgz of a code sample : http://archon.adept.free.fr/asioproblem.tgzIn the archive you'll find a server and a client directory. in eachdirectory you'll find a compile.sh file you'll have to adapt to yourconfiguration.In the file asiotestserver/TcpConnection.cpp line 131 you''ll find a commentexplaining 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?
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.