Art Tevs
2011-11-10 10:24:22 UTC
Hi folks,
I am not sure if there is something completely broken in my
implementation or I just don't quit get something about boost's asio.
Following happens:
sender A sends with async_write() data over the socket (32bytes).
receiver B receives this data into a buffer with async_read(
buffer(&_buf[0], _buf.size()), transfer_all(), handler(...) ). Now
while receiver B handles the data in the handler, sender A send new
data chunk again (32 bytes).
Now using the VisualStudio debugger, I was able to see that the buffer
on the receiver side get altered after the second send of A.
It means, even before receiver B was able to consume the data, it get
already overwritten by the new data...
What is going on here??? Does somebody encountered such behavior
before? Shouldn't the buffer be only altered before handler is called
and not while handler is running. Is there any other way to overcome
this problem?
I am using Boost 1.47.
Best regards and thank you in advance,
art
I am not sure if there is something completely broken in my
implementation or I just don't quit get something about boost's asio.
Following happens:
sender A sends with async_write() data over the socket (32bytes).
receiver B receives this data into a buffer with async_read(
buffer(&_buf[0], _buf.size()), transfer_all(), handler(...) ). Now
while receiver B handles the data in the handler, sender A send new
data chunk again (32 bytes).
Now using the VisualStudio debugger, I was able to see that the buffer
on the receiver side get altered after the second send of A.
It means, even before receiver B was able to consume the data, it get
already overwritten by the new data...
What is going on here??? Does somebody encountered such behavior
before? Shouldn't the buffer be only altered before handler is called
and not while handler is running. Is there any other way to overcome
this problem?
I am using Boost 1.47.
Best regards and thank you in advance,
art