Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Http;
|
||||
@@ -9,27 +10,31 @@ namespace App\Framework\Http;
|
||||
final class WebSocketConnection
|
||||
{
|
||||
private bool $isConnected = true;
|
||||
|
||||
private array $attributes = [];
|
||||
|
||||
public function __construct(
|
||||
private readonly string $id,
|
||||
private $socket
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sendet eine Text-Nachricht
|
||||
*/
|
||||
public function send(string $message): bool
|
||||
{
|
||||
if (!$this->isConnected) {
|
||||
if (! $this->isConnected) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$frame = $this->createFrame($message, 0x1); // Text frame
|
||||
|
||||
return fwrite($this->socket, $frame) !== false;
|
||||
} catch (\Throwable $e) {
|
||||
$this->disconnect();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -47,15 +52,17 @@ final class WebSocketConnection
|
||||
*/
|
||||
public function sendBinary(string $data): bool
|
||||
{
|
||||
if (!$this->isConnected) {
|
||||
if (! $this->isConnected) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$frame = $this->createFrame($data, 0x2); // Binary frame
|
||||
|
||||
return fwrite($this->socket, $frame) !== false;
|
||||
} catch (\Throwable $e) {
|
||||
$this->disconnect();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -65,15 +72,17 @@ final class WebSocketConnection
|
||||
*/
|
||||
public function ping(string $data = ''): bool
|
||||
{
|
||||
if (!$this->isConnected) {
|
||||
if (! $this->isConnected) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$frame = $this->createFrame($data, 0x9); // Ping frame
|
||||
|
||||
return fwrite($this->socket, $frame) !== false;
|
||||
} catch (\Throwable $e) {
|
||||
$this->disconnect();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +92,7 @@ final class WebSocketConnection
|
||||
*/
|
||||
public function close(int $code = 1000, string $reason = ''): void
|
||||
{
|
||||
if (!$this->isConnected) {
|
||||
if (! $this->isConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user