Skip to content

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.

Type: constexpr uint64_t

Default inactive timeout (matches Ryujinx)

Type: uint64_t

Timeout duration.

Type: TimeoutCallback

Callback to invoke on timeout.

Type: uint64_t

When timeout was started.

Type: bool

True if timeout is active.

Type: os::Mutex

Thread safety.

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)
void ~NetworkTimeout()

Destructor - cancels any pending timeout.

void NetworkTimeout(const&)

Parameters:

  • param (const&)
& operator=(const&)

Parameters:

  • param (const&)

Returns: &

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

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.

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

bool IsActive()

Check if timeout is currently active.

Returns: bool