walkor 2 years ago
parent
commit
fc66e2048a
2 changed files with 14 additions and 1 deletions
  1. 12 0
      src/Connection/AsyncTcpConnection.php
  2. 2 1
      src/Connection/ConnectionInterface.php

+ 12 - 0
src/Connection/AsyncTcpConnection.php

@@ -64,72 +64,84 @@ class AsyncTcpConnection extends TcpConnection
         'sslv3' => 'sslv3',
         'tls' => 'tls'
     ];
+
     /**
      * Emitted when socket connection is successfully established.
      *
      * @var ?callable
      */
     public $onConnect = null;
+
     /**
      * Emitted when websocket handshake completed (Only work when protocol is ws).
      *
      * @var ?callable
      */
     public $onWebSocketConnect = null;
+
     /**
      * Transport layer protocol.
      *
      * @var string
      */
     public string $transport = 'tcp';
+
     /**
      * Socks5 proxy.
      *
      * @var string
      */
     public string $proxySocks5 = '';
+
     /**
      * Http proxy.
      *
      * @var string
      */
     public string $proxyHttp = '';
+
     /**
      * Status.
      *
      * @var int
      */
     protected int $status = self::STATUS_INITIAL;
+
     /**
      * Remote host.
      *
      * @var string
      */
     protected string $remoteHost = '';
+
     /**
      * Remote port.
      *
      * @var int
      */
     protected int $remotePort = 80;
+
     /**
      * Connect start time.
      *
      * @var float
      */
     protected float $connectStartTime = 0;
+
     /**
      * Remote URI.
      *
      * @var string
      */
     protected string $remoteURI = '';
+
     /**
      * Context option.
      *
      * @var array
      */
     protected array $socketContext = [];
+
     /**
      * Reconnect timer.
      *

+ 2 - 1
src/Connection/ConnectionInterface.php

@@ -20,11 +20,12 @@ use Throwable;
 use Workerman\Events\Event;
 use Workerman\Events\EventInterface;
 use Workerman\Worker;
+use AllowDynamicProperties;
 
 /**
  * ConnectionInterface.
  */
-#[\AllowDynamicProperties]
+#[AllowDynamicProperties]
 abstract class ConnectionInterface
 {
     /**