Re: [Boost-users] [Asio]Question about error_code when socket::close

Then you need to do reference counting yourself. You must count pending asynchronous I/O operations and destroy the object when the counter is decreased to 0. I don't think there is much else you can do?
Boris
Thanks, that's a good idea and what I intended to do. Some what ugly, but can be hidden under the table :-)

Thanks, that's a good idea and what I intended to do. Some what ugly, but can be hidden under the table :-)
But before you begin doing this, it's worth ensuring that you *really* have a bottleneck there (which is unlikely in a network-oriented application).

But before you begin doing this, it's worth ensuring that you *really* have a bottleneck there (which is unlikely in a network-oriented application).
BTW, you also can try to use a trivial custom allocator that would eliminate some heap allocations in completion handlers (unrelated to shared_ptr): http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/example/allocation/...
participants (2)
-
Igor R
-
鑫炜廖