This commit is contained in:
Marcel Pociot
2020-04-16 15:30:53 +02:00
parent e49708b290
commit 2778d5a489
22 changed files with 960 additions and 206 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Server\Messages;
use App\Server\Connections\ConnectionManager;
use Illuminate\Support\Str;
use Ratchet\ConnectionInterface;
use React\EventLoop\LoopInterface;
use stdClass;
class ControlMessage implements Message
@@ -45,6 +46,13 @@ class ControlMessage implements Message
'subdomain' => $connectionInfo->subdomain,
'client_id' => $connectionInfo->client_id
]));
$loop = app(LoopInterface::class);
$timer = $loop->addPeriodicTimer(5, function () use ($connection) {
$connection->send(json_encode([
'event' => 'ping'
]));
});
}
protected function registerProxy(ConnectionInterface $connection, $data)