|
LibQuicR
|
Represents one reusable TRACK_STATUS request. More...
#include <track_status_handler.h>
Public Types | |
| enum class | Status : std::uint8_t { kNotRequested , kPendingResponse , kOk , kError , kDoneByFin , kDoneByReset , kNotConnected } |
| Lifecycle state of the most recent query. More... | |
Public Member Functions | |
| Status | GetStatus () const |
| std::optional< TrackStatusResponse > | GetResponse () const |
| std::optional< Error< ErrorCode > > | GetError () const |
| virtual void | StatusChanged (Status status) |
Reports completion with kOk or kError. More... | |
| template<typename T > | |
| requires std::is_base_of_v< TrackHandler, T > std::shared_ptr< T > | Get () |
| Get the derived type of the track handler. More... | |
| void | SetRequestId (std::optional< uint64_t > request_id) |
| Sets or clears the connection-scoped request ID. More... | |
| std::optional< uint64_t > | GetRequestId () const noexcept |
| Get the request ID. More... | |
| std::optional< uint64_t > | GetRequestStreamId () const |
| Get the stream ID of the request control stream. More... | |
| FullTrackName | GetFullTrackName () const noexcept |
| Get the full track name. More... | |
| uint64_t | GetConnectionId () const noexcept |
| Gets the transport connection identifier assigned by the session. More... | |
| std::shared_ptr< Connection > | GetConnection () const |
| Binding | GetBinding () const |
Static Public Member Functions | |
| static std::shared_ptr< TrackStatusHandler > | Create (const FullTrackName &full_track_name) |
| Creates a track-status request handler. More... | |
Protected Member Functions | |
| TrackStatusHandler (const FullTrackName &full_track_name) | |
| Constructs an unsubmitted request for a track. More... | |
| void | RequestOkReceived (const messages::Parameters ¶ms) override |
| Rejects an impossible generic REQUEST_OK path. More... | |
| void | RequestError (ErrorCode error_code, std::string reason) override |
| Records a peer rejection while a response is pending. More... | |
| Reply< messages::Parameters, ErrorCode > | RequestUpdateReceived (const messages::Parameters ¶ms) override |
| Rejects REQUEST_UPDATE for a TRACK_STATUS request. More... | |
| void | SetTransport (std::shared_ptr< Session > transport) |
| Sets the session used for control and data operations. More... | |
| const std::weak_ptr< Session > & | GetSession () const noexcept |
| Gets the non-owning session handle. More... | |
Protected Attributes | |
| FullTrackName | full_track_name_ |
| Full track identity retained for the handler's lifetime. More... | |
| std::mutex | binding_operation_mutex_ |
Represents one reusable TRACK_STATUS request.
Pass the handler to Session::RequestTrackStatus. Getters are synchronized and may be called from other threads. StatusChanged is invoked on session processing paths after a response or error; stream-close and disconnect status changes currently do not invoke it. A completed handler may be submitted again, but not while a response is pending.
|
strong |
Lifecycle state of the most recent query.
| Enumerator | |
|---|---|
| kNotRequested | Ready to be passed to Session. |
| kPendingResponse | Waiting for response from the peer. |
| kOk | Response received. |
| kError | The peer rejected the query; GetError() contains its reason. |
| kDoneByFin | The peer closed the stream without a response. |
| kDoneByReset | The peer reset the stream without a response. |
| kNotConnected | Transport disconnected. |
|
explicitprotected |
Constructs an unsubmitted request for a track.
| full_track_name | Track to query. |
|
inlinestatic |
Creates a track-status request handler.
| full_track_name | Track to query. |
kNotRequested.
|
inlineinherited |
Get the derived type of the track handler.
| T | Derived type of the track handler. |
T, or null when the dynamic type is incompatible. | std::bad_weak_ptr | if this object is not currently owned by a shared_ptr. |
|
inlineinherited |
|
inherited |
|
inlinenoexceptinherited |
Gets the transport connection identifier assigned by the session.
std::nullopt until/unless status is kError.
|
inlinenoexceptinherited |
Get the full track name.
|
inlinenoexceptinherited |
Get the request ID.
std::nullopt when none is assigned.
|
inherited |
Get the stream ID of the request control stream.
std::nullopt if no stream is attached. | std::optional<TrackStatusResponse> quicr::TrackStatusHandler::GetResponse | ( | ) | const |
std::nullopt until/unless status is kOk.
|
protectednoexceptinherited |
Gets the non-owning session handle.
| Status quicr::TrackStatusHandler::GetStatus | ( | ) | const |
|
overrideprotectedvirtual |
Records a peer rejection while a response is pending.
| error_code | Peer-provided request error code. |
| reason | Peer-provided diagnostic text, moved into the stored error. |
A late error received after the pending state ended is ignored.
Reimplemented from quicr::TrackHandler.
|
overrideprotectedvirtual |
Rejects an impossible generic REQUEST_OK path.
| params | Unused response parameters. |
| std::logic_error | Always; TRACK_STATUS responses are decoded directly by the session. |
Implements quicr::TrackHandler.
|
overrideprotectedvirtual |
Rejects REQUEST_UPDATE for a TRACK_STATUS request.
| params | Unused update parameters. |
| messages::ProtocolViolationException | Always. |
Implements quicr::TrackHandler.
|
inlineinherited |
Sets or clears the connection-scoped request ID.
| request_id | Request ID assigned by the session, or std::nullopt when unbound. |
|
protectedinherited |
Sets the session used for control and data operations.
| transport | Session retained weakly; passing null clears effective access. |
|
virtual |
Reports completion with kOk or kError.
| status | New terminal status. |
|
protectedinherited |
|
protectedinherited |
Full track identity retained for the handler's lifetime.