Skip to content

Commit

Permalink
Update Server.php
Browse files Browse the repository at this point in the history
  • Loading branch information
localzet committed Nov 22, 2024
1 parent ef2dcd0 commit 206a263
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,22 @@ class Server extends ServerAbstract
public function __construct(?string $socketName = null)
{
if ($socketName) {
$this->server = localzet_start(
localzet_start(
name: 'Tunnel',
count: 1,
listen: $socketName,
reloadable: false,
handler: $this::class,
);
$this->server->channels = [];
}
}

public function onServerStart(LocalzetServer &$server): void
{
$this->server = $server;
$this->server->channels = [];
}

/**
* @param TcpConnection $connection
* @return void
Expand Down Expand Up @@ -142,6 +148,7 @@ public function onMessage(ConnectionInterface &$connection, mixed $request): voi
$connection->send($buffer);
}
break;

case 'watch':
foreach ($channels as $channel) {
if (isset($this->queues[$channel])) {
Expand Down

0 comments on commit 206a263

Please sign in to comment.