Asynchronous datagram-oriented transport interface.
Main docs: Home
Classes | |
| class | pw::transport::ReliableDatagramSocket |
| class | pw::transport::WriteReservation |
| class | pw::transport::ReadFuture |
| class | pw::transport::ReserveWriteFuture |
| class | pw::transport::CloseFuture |
Future representing waiting for a ReliableDatagramSocket to close. More... | |
| class | pw::transport::ReliableDatagramSocketImpl |
| class | pw::transport::ReliableDatagramListener |
| class | pw::transport::ReliableDatagramConnector |
Functions | |
| size_t | pw::transport::ReliableDatagramSocket::max_write_message_size_bytes () const |
The maximum size in bytes that can be requested in a ReserveWrite. | |
| size_t | pw::transport::ReliableDatagramSocket::max_read_message_size_bytes () const |
| The maximum size in bytes of a single datagram received from the peer. | |
| ReadFuture | pw::transport::ReliableDatagramSocket::Read () const |
| ReserveWriteFuture | pw::transport::ReliableDatagramSocket::ReserveWrite (size_t min_size_bytes) const |
| std::optional< WriteReservation > | pw::transport::ReliableDatagramSocket::TryReserveWrite (size_t min_size_bytes) const |
| CloseFuture | pw::transport::ReliableDatagramSocket::Close () const |
| CloseFuture | pw::transport::ReliableDatagramSocket::WhenClosed () const |
|
inline |
Terminally closes the socket, resolving once it has been fully torn down. If the socket is already closed, this is a no-op.
|
inline |
Receives a single datagram from the peer, resolving to a ConstBuf view of its data. Resolves to a null ConstBuf when the socket is closed.
Only one Read operation may be pended at a time. Pending a second ReadFuture while one is active will assert.
ConstBuf is a view into memory provided by the transport and should be processed and destroyed as quickly as reasonably possible to avoid potential head-of-line blocking or exhaustion of transport buffers.
|
inline |
Requests to write a datagram of size at least min_size_bytes, waiting for space to become available.
Resolves to a std::optional<WriteReservation> that allows writing to that buffer, or std::nullopt if the socket has closed.
Multiple reservations or reservation requests can be outstanding at once. If multiple pending requests exist, the order in which they are resolved is not specified.
An empty datagram can be sent by requesting a size of 0. Requesting larger than max_write_message_size_bytes will assert.
|
inline |
Synchronously attempts to reserve space for writing a datagram of at least min_size_bytes.
Returns std::nullopt if space is not immediately available or if the socket is closed.
An empty datagram can be sent by requesting a size of 0. Requesting larger than max_write_message_size_bytes will assert.
|
inline |
Returns a future that resolves when the socket is terminally closed or disconnected.