Detect a TLS client handshake on a stream.
Defined in header
template< class SyncReadStream, class DynamicBuffer> bool detect_ssl( SyncReadStream& stream, DynamicBuffer& buffer, error_code& ec);
This function reads from a stream to determine if a client handshake message is being received. The call blocks until one of the following is true:
The algorithm, known as a composed operation, is implemented
in terms of calls to the next layer's
function. Bytes read from the stream will be stored in the passed dynamic
buffer, which may be used to perform the TLS handshake if the detector returns
true, or be otherwise consumed by the caller based on the expected protocol.
The stream to read from. This type must meet the requirements of SyncReadStream.
The dynamic buffer to use. This type must meet the requirements of DynamicBuffer.
Set to the error if any occurred.
true if the buffer contains
a TLS client handshake and no error occurred, otherwise