Fixed length I/O buffers are usually used with I/O operations and play the role of either a data source or destination when the size of the message to be sent or received is known. For example, this can be a constant array of chars allocated on a stack, which contain a string that represents the request to be sent to the server. Or, this can be a writable buffer allocated in the free memory, which is used as a data destination point, when reading data from a socket.
In this recipe, we'll see how to represent fixed length buffers so that they can be used with Boost.Asio I/O operations.
In Boost.Asio, a fixed length buffer is represented by one of the two classes: