
Hi Chris,
I made a few quick changes and re-ran the daytime3 server to observe the memory allocations. What I changed was:
<some code>
Looks good. Eliminating "null()" makes things much better. However the underlying shared_ptr<socket> is quite important. Until you find a better solution, you could try to use a simple segregated storage (boost::pool or similar) for socket allocation to minimize memory use (in 32 systems unsigned int has the same size as a pointer) and the user could define BOOST_SP_USE_QUICK_ALLOCATOR so that shared_ptr's shared_count objects are also pooled. This way, memory waste will be minimum and the allocation very fast. Now we just need a way to provide a custom allocation for async_xxx operations. I will follow Christopher Baus' proposal. Regards, Ion