Boost logo

Boost Users :

Subject: Re: [Boost-users] asio::async_write
From: Igor R (boost.lists_at_[hidden])
Date: 2009-11-18 10:10:33


>> It does make sense, if the handler is a lightweight copiable object.
>>
>
> What if the handler take so much time in execution?

I don't understand how the execution time is relevant for this issue.
Your handler must outlive your async. event, i.e. the object you pass
to async_write must be alive when the write operation is complete.
You can achive this in various ways, among them - by passing a smart
pointer to a heap-allocated object, or by passing an object by-value.


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