From 01afa298ba6236c4991fec425c4ae3f4936a2d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 16:49:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Rpc/RpcService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Annotation/Rpc/RpcService.php b/Annotation/Rpc/RpcService.php index d5588dd9..a92b03d6 100644 --- a/Annotation/Rpc/RpcService.php +++ b/Annotation/Rpc/RpcService.php @@ -27,16 +27,18 @@ use Snowflake\Snowflake; * @param string $cmd * @param string $host * @param int $port + * @param int $timeout * @param int $mode */ public function __construct( public string $cmd, public string $host, public int $port, + public int $timeout = 1, public int $mode = SWOOLE_SOCK_TCP6 ) { - $this->config = ['host' => $this->host, 'port' => $this->port, 'mode' => $this->mode]; + $this->config = ['host' => $host, 'port' => $port, 'mode' => $mode, 'timeout' => $timeout]; }