yingzi 2 лет назад
Родитель
Сommit
ba1efcea5b
1 измененных файлов с 15 добавлено и 5 удалено
  1. 15 5
      Mall/Framework/Swoole/WebsocketClient.Class.php

+ 15 - 5
Mall/Framework/Swoole/WebsocketClient.Class.php

@@ -116,14 +116,24 @@ class WebSocketClient
     {
         if (extension_loaded('swoole'))
         {
-            $type = SWOOLE_TCP;
-            if ($this->ssl)
-            {
-                $type |= SWOOLE_SSL;
+//            $type = SWOOLE_TCP;
+//            if ($this->ssl)
+//            {
+//                $type |= SWOOLE_SSL;
+//            }
+//            $this->socket = new \swoole_client($type);
+            if($this->ssl){
+                $this->socket = new \swoole_client(SWOOLE_SOCK_TCP | SWOOLE_SSL);
+            }else{
+                $this->socket = new \swoole_client(SWOOLE_SOCK_TCP);
             }
-            $this->socket = new \swoole_client($type);
+            
+            
+            
             if ($this->ssl_key_file)
             {
+                var_dump($this->ssl_cert_file);
+                var_dump("xxaa");
                 $this->socket->set(array(
                     'ssl_key_file' => $this->ssl_key_file,
                     'ssl_cert_file' => $this->ssl_cert_file,