game-common / pragma.loadsimulator / OldStackKeepAlive /

OldStackKeepAlive #

internal class OldStackKeepAlive(client: PragmaClient, child: BackgroundManager, heartbeatMillis: Long, stopTimeoutMillis: Long = STOP_TIMEOUT_MILLIS)

Keep-alive and watchdog for a client on the old pragma.client stack, which owns neither. Mirrors the new stack’s ClientSession.

Constructors #

OldStackKeepAlive

fun OldStackKeepAlive(client: PragmaClient, child: BackgroundManager, heartbeatMillis: Long, stopTimeoutMillis: Long = STOP_TIMEOUT_MILLIS)

Functions #

NameSummary

disconnect

suspend fun disconnect()

Orderly disconnect requested by the loadsim: stops the loops and both sockets. Safe after a watchdog teardown.

heartbeat

private suspend fun heartbeat(connection: BackendConnection, backend: String)

One heartbeat round-trip; a failure result is thrown so the loop treats it like any other failed send.

start

fun start()

Starts the heartbeat and token-refresh loops; only session kinds that expire without them call this.