|
Hermes 0.7.0
Linux game streaming host
|
Public Types | |
| using | clock = std::chrono::steady_clock |
Public Member Functions | |
| std::optional< std::chrono::milliseconds > | on_message (clock::time_point now) noexcept |
| void | on_periodic_ping () noexcept |
| The client sends periodic pings, so its silences mean something. | |
| std::optional< std::chrono::milliseconds > | silence_before (clock::time_point now) const noexcept |
| std::chrono::milliseconds | since_last_silence (clock::time_point now) const noexcept |
| How long ago the most recent silence ended, relative to now. | |
| std::uint64_t | silence_count () const noexcept |
| std::chrono::milliseconds | longest_silence () const noexcept |
| std::chrono::milliseconds | total_silence () const noexcept |
Static Public Attributes | |
| static constexpr std::chrono::milliseconds | silence_threshold {150} |
| static constexpr std::chrono::milliseconds | attribution_window {200} |
| A key-frame request this soon after a silence ended is attributed to it. | |
How long a client goes without sending anything on the control connection.
A Moonlight-family client sends a periodic ping every 100 ms besides its input, so a longer silence means its network link, or the client itself, stopped for that long while the host kept streaming. That is invisible in everything the host measures about its own sending, and it is what a client's Wi-Fi scan or power saving looks like from here: the client comes back, finds frames missing, and asks for a key frame.
Nothing is reported until the client has sent a periodic ping, so a client that stays quiet while idle is never mistaken for one that went missing. The last-heard state belongs to the control thread; the totals are atomic so a session can be summarized from whichever thread stops it.
Definition at line 33 of file client_link_monitor.cppm.
| using stream::client_link_monitor_t::clock = std::chrono::steady_clock |
Definition at line 35 of file client_link_monitor.cppm.
|
inlinenodiscardnoexcept |
Definition at line 107 of file client_link_monitor.cppm.
|
inlinenoexcept |
Record a message from the client.
Definition at line 52 of file client_link_monitor.cppm.
|
inlinenoexcept |
The client sends periodic pings, so its silences mean something.
Definition at line 81 of file client_link_monitor.cppm.
|
inlinenodiscardnoexcept |
The silence that ended within attribution_window of now, if any. Called when the client asks for a key frame.
Definition at line 89 of file client_link_monitor.cppm.
|
inlinenodiscardnoexcept |
Definition at line 103 of file client_link_monitor.cppm.
|
inlinenodiscardnoexcept |
How long ago the most recent silence ended, relative to now.
Definition at line 97 of file client_link_monitor.cppm.
|
inlinenodiscardnoexcept |
Definition at line 111 of file client_link_monitor.cppm.
|
staticconstexpr |
A key-frame request this soon after a silence ended is attributed to it.
Definition at line 46 of file client_link_monitor.cppm.
|
staticconstexpr |
One and a half periodic-ping intervals. In a real session the gaps between client messages stayed within 90-110 ms and none fell between 110 and 170 ms; each of that session's 14 key-frame requests followed a longer one.
Definition at line 43 of file client_link_monitor.cppm.