Re: [asio-users] Bad address with async_write callback
Brought to you by:
chris_kohlhoff
|
From: James V. <jam...@fr...> - 2008-09-26 17:41:43
|
OK. I have gone through my own code with a fine comb and can no longer find any point where I modify the buffer whilst the sendmsg() op in boost happens - my application is single threaded for a start.
The session object itself is valid as is the streambuf object it holds (according to gdb). I have look throug the boost code and essentially, on Linux, when sendmsg() finally executes the msg it sends is a pointer to my buffer anyway right? No copy is made is it?
So how can the address be invalid? If my application is single threaded I only write to the buffer myself in series:
while (!done) {
io_service.run(); // executes async_write
session.write(data); // copies data into the streambuf and registers async_write
}
could run not have run all handlers and therefore still have one waiting to execute but when it comes to it's turn in the next poll the session.write() call has modified streambufs internal pointers?
Jim
----- Original Message -----
From: "Christopher Kohlhoff" <ch...@ko...>
To: asi...@li...
Sent: Friday, 26 September, 2008 12:50:13 AM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [asio-users] Bad address with async_write callback
James Vanns wrote:
> It may be possible that it is appended to. In this context, does this matter?
Yes, since appending data can cause the internal buffer to be
reallocated or rotated.
Cheers,
Chris
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
asio-users mailing list
asi...@li...
https://lists.sourceforge.net/lists/listinfo/asio-users
--
James Vanns
Systems Programmer
Framestore CFC Ltd.
|