
15 May
2012
15 May
'12
6:08 p.m.
I have one more question. If i use one thread instead of 2 threads utilizing io_service.run(), I wouldn't see this issue, right? since only one CallBack is handled by the same thread in sequential way.
Thanks, Mustafa
Hi Mustafa, You're probably seeing the segfault because the buffer you passed to async_send is invalidated before the send completes (due to vector reallocation). So you need to ensure that the buffer remains valid until the async_send completion is invoked, for instance your container could be managed by a shared_ptr that is passed to the completion handler. Best regards, Martin Dyring-Andersen