diff --git a/src/Communication/Socket/Socket.php b/src/Communication/Socket/Socket.php index ab98f86..d9a9a5f 100644 --- a/src/Communication/Socket/Socket.php +++ b/src/Communication/Socket/Socket.php @@ -16,13 +16,21 @@ */ class Socket implements SocketInterface, SelectableSocketInterface { + + /** + * @var resource + */ + protected mixed $socket; + /** * @param resource|Socket $socket */ - public function __construct(protected mixed $socket) + public function __construct(mixed $socket) { - if ($this->socket instanceof Socket) { - $this->socket = $this->socket->getStream(); + if ($socket instanceof Socket) { + $this->socket = $socket->getStream(); + } else { + $this->socket = $socket; } stream_set_blocking($this->socket, false); }