I last ponged timestamp

This commit is contained in:
Fabian @ Blax Software 2026-03-21 10:01:10 +01:00
parent 35b2731349
commit d091ebbd82
1 changed files with 6 additions and 0 deletions

View File

@ -181,6 +181,12 @@ class Handler implements MessageComponentInterface
MessageInterface $message, MessageInterface $message,
string $payload string $payload
): void { ): void {
// Any received message proves the client is alive — update pong timestamp
// to prevent removeObsoleteConnections() from unsubscribing active connections.
// This is critical because heartbeat pings with unique suffixes (e.g. pusher.ping[abc])
// bypass tryHandlePingFast() and handlePusherEvent() doesn't call connectionPonged().
$connection->lastPongedAt = time();
// Set remote address once (moved from per-message to reduce overhead) // Set remote address once (moved from per-message to reduce overhead)
if (isset($connection->remoteAddress)) { if (isset($connection->remoteAddress)) {
request()->server->set('REMOTE_ADDR', $connection->remoteAddress); request()->server->set('REMOTE_ADDR', $connection->remoteAddress);