
I have a server running with asio. At any time i have 5000+ persistent connections from clients, but not all of them are sending/receiving data at all times. In fact, they only do requests once in a while. The problem is (with my current approach) that i need to have 5000+ memory buffers ready to receive that requests of very varying length. How could i make it so i can set the buffer to use at the exact moment in which data for a new request in an already open connection begins to arrive? And maybe have those buffers in some memory pool. I've been studying http://www.boost.org/doc/libs/1_38_0/doc/html/boost_asio/example/allocation/... without understanding it completely, but it doesn't look like what im looking for. Any ideas? Thanks a lot in advance. Alejandro