mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Add Add test::stream::lowest_layer:
This allows the stream to be used as the next layer type in a stack of network stream layers. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
committed by
Vinnie Falco
parent
30b98674d5
commit
96c53a048f
@ -3,6 +3,7 @@ Version 110:
|
||||
* Refactor stream open state variable
|
||||
* Refactor websocket stream members
|
||||
* Refactor websocket stream: fixes and tests
|
||||
* Add test::stream::lowest_layer
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -113,6 +113,9 @@ class stream
|
||||
public:
|
||||
using buffer_type = flat_buffer;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type = stream;
|
||||
|
||||
/// Destructor
|
||||
~stream()
|
||||
{
|
||||
@ -209,6 +212,34 @@ public:
|
||||
return in_->ios;
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers.
|
||||
*/
|
||||
lowest_layer_type&
|
||||
lowest_layer()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Get a reference to the lowest layer
|
||||
|
||||
This function returns a reference to the lowest layer
|
||||
in a stack of stream layers.
|
||||
|
||||
@return A reference to the lowest layer in the stack of
|
||||
stream layers. Ownership is not transferred to the caller.
|
||||
*/
|
||||
lowest_layer_type const&
|
||||
lowest_layer() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Set the maximum number of bytes returned by read_some
|
||||
void
|
||||
read_size(std::size_t n)
|
||||
|
Reference in New Issue
Block a user