作者 karlet

feat:健壮websocket

@@ -81,7 +81,7 @@ class Websocket @@ -81,7 +81,7 @@ class Websocket
81 if ($ret) { 81 if ($ret) {
82 output($this->desc, "连接成功"); 82 output($this->desc, "连接成功");
83 $this->client=&$client; 83 $this->client=&$client;
84 - swoole_timer_after(50, function () use ($onOpen) { 84 + swoole_timer_after(50, function () use ($onOpen,$client) {
85 if ($onOpen) { 85 if ($onOpen) {
86 call_user_func($onOpen, $client); 86 call_user_func($onOpen, $client);
87 } 87 }