diff --git a/TSwooleClient.php b/TSwooleClient.php index baa600d..b306cfe 100644 --- a/TSwooleClient.php +++ b/TSwooleClient.php @@ -8,31 +8,34 @@ trait TSwooleClient { + /** + * @return array + */ + #[Pure] private function settings(): array + { + $sslCert = $this->getSslCertFile(); + $sslKey = $this->getSslKeyFile(); + $sslCa = $this->getCa(); - /** - * @return array - */ - #[Pure] private function settings(): array - { - $sslCert = $this->getSslCertFile(); - $sslKey = $this->getSslKeyFile(); - $sslCa = $this->getCa(); + $params = [ + 'open_eof_check' => true, + 'package_eof' => "\r\n\r\n", + 'package_max_length' => 1024 * 1024 * 2, + ]; + if ($this->getConnectTimeout() > 0) { + $params['timeout'] = $this->getConnectTimeout(); + } + if (empty($sslCert) || empty($sslKey) || empty($sslCa)) { + return $params; + } - $params = []; - if ($this->getConnectTimeout() > 0) { - $params['timeout'] = $this->getConnectTimeout(); - } - if (empty($sslCert) || empty($sslKey) || empty($sslCa)) { - return $params; - } + $params['ssl_host_name'] = $this->getHost(); + $params['ssl_cert_file'] = $this->getSslCertFile(); + $params['ssl_key_file'] = $this->getSslKeyFile(); + $params['ssl_verify_peer'] = TRUE; + $params['ssl_cafile'] = $sslCa; - $params['ssl_host_name'] = $this->getHost(); - $params['ssl_cert_file'] = $this->getSslCertFile(); - $params['ssl_key_file'] = $this->getSslKeyFile(); - $params['ssl_verify_peer'] = TRUE; - $params['ssl_cafile'] = $sslCa; - - return $params; - } + return $params; + } }