Nexus HTTP/3
A QUIC and HTTP/3 library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nexus::quic::stream Class Reference

a generic bidirectional QUIC stream that meets the type requirements of asio's AsyncRead/WriteStream and SyncRead/WriteStream More...

#include <nexus/quic/stream.hpp>

Inheritance diagram for nexus::quic::stream:
nexus::h3::stream

Public Types

using executor_type = detail::stream_impl::executor_type
 the polymorphic executor type, boost::asio::any_io_executor
 

Public Member Functions

 stream (connection &conn)
 construct a stream associated with the given connection
 
 ~stream ()
 reset the stream on destruction
 
 stream (const stream &)=delete
 
streamoperator= (const stream &)=delete
 
 stream (stream &&)=delete
 
streamoperator= (stream &&)=delete
 
executor_type get_executor () const
 return the associated io executor
 
bool is_open () const
 determine whether the stream is open
 
stream_id id (error_code &ec) const
 return the stream identifier if open. for streams initiated locally, an identifier may not be assigned until the first STREAM frame is sent
 
stream_id id () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename MutableBufferSequence , typename CompletionToken >
decltype(auto) async_read_some (const MutableBufferSequence &buffers, CompletionToken &&token)
 read some bytes into the given buffer sequence
 
template<typename MutableBufferSequence >
size_t read_some (const MutableBufferSequence &buffers, error_code &ec)
 read some bytes into the given buffer sequence
 
template<typename MutableBufferSequence >
size_t read_some (const MutableBufferSequence &buffers)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename ConstBufferSequence , typename CompletionToken >
decltype(auto) async_write_some (const ConstBufferSequence &buffers, CompletionToken &&token)
 write some bytes from the given buffer sequence. written bytes may be buffered until they fill an outgoing packet
 
template<typename ConstBufferSequence >
size_t write_some (const ConstBufferSequence &buffers, error_code &ec)
 write some bytes from the given buffer sequence. written bytes may be buffered until they fill an outgoing packet
 
template<typename ConstBufferSequence >
size_t write_some (const ConstBufferSequence &buffers)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void flush (error_code &ec)
 flush any bytes that were buffered by write_some()/async_write_some() but not yet delivered
 
void flush ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void shutdown (int how, error_code &ec)
 shut down a stream for reads (0), writes (1), or both (2). shutting down the read side will cancel any pending read operations. shutting down the write side will flush any buffered data, and cancel any pending write operations
 
void shutdown (int how)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename CompletionToken >
decltype(auto) async_close (CompletionToken &&token)
 close the stream gracefully, blocking until all written data is acknowledged by the peer. the associated connection must remain open until this graceful shutdown completes
 
void close (error_code &ec)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void close ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void reset ()
 reset the stream immediately in both directions, canceling any pending operations and discarding any unacked data
 

Protected Member Functions

 stream (detail::connection_impl &impl)
 

Protected Attributes

detail::stream_impl impl
 

Detailed Description

a generic bidirectional QUIC stream that meets the type requirements of asio's AsyncRead/WriteStream and SyncRead/WriteStream