On 09/16/2014 09:36 AM, Maciej Miszczak wrote:
lowest_layer to any of OSI layers). Could someone explain the meaning of next_layer and lowest_layer
As you already have inferred, these "layers" have nothing to do with the OSI model. They refer to types in an inheritance chain; actually, that is not necessarily true in the general case, but it is an adequate approximation for understanding them. lowest_layer() returns a reference to a basic_socket<>, which is the base class for both basic_stream_socket<> (ip::tcp::socket) and basic_datagram_socket<> (ip::udp::socket), so you can only use functions that they have in common. next_layer() returns a reference to the socket type that you have wrapped. For ssl::streamip::tcp::socket it returns ip::tcp::socket&.