Use case: TCP server that detects TLS by inspecting the first few bytes of the accepted TCP connection, then do the TLS handshake if applicable.
In ASIO, there is an async_handshake overload that accepts buffers with pre-read data. Something similar seems to be missing in corosio. A custom stream type that supports "rewinding" or prepending a pre-read buffer could be another option.
But I guess the straightforward option is to allow passing a dynamic buffer, similar to capy::read_until.
This is closely related to #95
Use case: TCP server that detects TLS by inspecting the first few bytes of the accepted TCP connection, then do the TLS handshake if applicable.
In ASIO, there is an
async_handshakeoverload that accepts buffers with pre-read data. Something similar seems to be missing in corosio. A custom stream type that supports "rewinding" or prepending a pre-read buffer could be another option.But I guess the straightforward option is to allow passing a dynamic buffer, similar to
capy::read_until.This is closely related to #95