Boost logo

Boost Users :

Subject: Re: [Boost-users] asio::async_write
From: Lloyd (lloyd_at_[hidden])
Date: 2009-11-18 04:37:31


>
> Note that shared_from_this will not work unless object is created on
> heap and placed in a shared_ptr.
>

Thanks. Now it works. While binding I passed "this" instead of
"shared_ptr", like this

boost::bind(&aa::HandleWrite,this/*shared_from_this()*/,boost::asio::placeholders::error)

> Creating asynchronous operation handlers on stack does not make much
> sense.
>

Why do you say this? Is there any chance of crashing the application?

______________________________________
Scanned and protected by Email scanner


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