Difference between low_layer () and next_layer () from Boost Asio SSL Stream

The documentation seems to say little: low_layer () , next_layer () .

What is the difference between them and when to use them?

+4
source share
1 answer

To answer this, you need to remember that it boost::asio::ssl::streamis a template class. Usually it looks like boost::asio::ssl::stream<boost::asio::ip::tcp::socket>. So used boost::asio::ip::tcp::socket. This will be next_layer for boost::asio::ssl::stream. On the other hand, low_layer will always be basic_socket(described in docs ).

, tcp::socket, typedef basic_stream_socket<Tcp>, basic_socket. .. "next_layer IS the low_layer"..

, ssl::stream< MyOwnClass >. next_layer MyOwnClass, / . low_layer , MyOwnClass typedef.

UPD: . next_layer / ( SSL, ). low_layer .

+3

Source: https://habr.com/ru/post/1607384/


All Articles