Use fixed-length buffers such as boost :: array when you know a priori how much data you expect to receive or send. ASIO streambufs allows you to receive an unknown amount of data. In particular, async_read_until requires the use of streambufs.
source share