Many I/O objects in Asio are stream-oriented. This means that:
Objects that provide stream-oriented I/O model one or more of the following type requirements:
SyncReadStream, where synchronous read operations are performed using a member function called
AsyncReadStream, where asynchronous read operations are performed using a member function called
SyncWriteStream, where synchronous write operations are performed using a member function called
AsyncWriteStream, where asynchronous write operations are performed using a member function called
Examples of stream-oriented I/O objects include
Programs typically want to transfer an exact number of bytes. When a short
read or short write occurs the program must restart the operation, and
continue to do so until the required number of bytes has been transferred.
Asio provides generic functions that do this automatically:
async_read_untilfunctions to violate their contract. E.g. a read of N bytes may finish early due to EOF.