ams::mitm::ldn::NetworkTimeout
ams::mitm::ldn::NetworkTimeout
Section titled “ams::mitm::ldn::NetworkTimeout”Network inactivity timeout manager.
Manages automatic disconnection from the RyuLdn server after a period of inactivity (no active network session).Thread SafetyAll methods are thread-safe via mutex protection.
Members
Section titled “Members”DEFAULT_IDLE_TIMEOUT_MS
Section titled “DEFAULT_IDLE_TIMEOUT_MS”Type: constexpr uint64_t
Default inactive timeout (matches Ryujinx)
Members
Section titled “Members”m_idle_timeout_ms
Section titled “m_idle_timeout_ms”Type: uint64_t
Timeout duration.
m_callback
Section titled “m_callback”Type: TimeoutCallback
Callback to invoke on timeout.
m_timeout_start_ms
Section titled “m_timeout_start_ms”Type: uint64_t
When timeout was started.
m_active
Section titled “m_active”Type: bool
True if timeout is active.
m_mutex
Section titled “m_mutex”Type: os::Mutex
Thread safety.
Methods
Section titled “Methods”NetworkTimeout
Section titled “NetworkTimeout”void NetworkTimeout(uint64_t idle_timeout_ms, TimeoutCallback callback)Constructor.
idle_timeout_msTimeout duration in millisecondscallbackFunction to call when timeout expiresparam
Parameters:
idle_timeout_ms(uint64_t)callback(TimeoutCallback)
~NetworkTimeout
Section titled “~NetworkTimeout”void ~NetworkTimeout()Destructor - cancels any pending timeout.
NetworkTimeout
Section titled “NetworkTimeout”void NetworkTimeout(const&)Parameters:
param(const&)
operator=
Section titled “operator=”& operator=(const&)Parameters:
param(const&)
Returns: &
RefreshTimeout
Section titled “RefreshTimeout”bool RefreshTimeout()Refresh the timeout (restart the timer)
Called after operations that keep the connection alive but don’t require being in a network (e.g., Scan, DisconnectNetwork).true always (for compatibility)return
Returns: bool
DisableTimeout
Section titled “DisableTimeout”void DisableTimeout()Disable the timeout (cancel any pending timer)
Called when entering a network session (CreateNetwork, Connect). The connection should stay alive while in a network.
CheckTimeout
Section titled “CheckTimeout”bool CheckTimeout(uint64_t current_time_ms)Check if timeout has expired.
Called periodically from update loop to check if timeout has elapsed and the callback should be invoked.current_time_msCurrent time in millisecondsparamtrue if timeout expired and callback was invokedreturn
Parameters:
current_time_ms(uint64_t)
Returns: bool
IsActive
Section titled “IsActive”bool IsActive()Check if timeout is currently active.
Returns: bool