国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

在webman中自定義進程使用mqtt的訂閱,為何提示Error: Class 'process\Workerman\Mqtt\Client' not found in D:\zpxprom\gitee\workman\zpx-mqtt_api\process\MqttTask.php:11

zhang

這個自定義進程為何老提示Error: Class 'process\Workerman\Mqtt\Client' not found
namespace process;
use Workerman\Worker;
class MqttTask
{
public function onWorkerStart()
{
$mqtt = new Workerman\Mqtt\Client('mqtt://127.0.0.1:1883', array(
'debug' => true,
"username"=>"admin", "password"=>"u123",
));
$mqtt->onConnect = function($mqtt) {
$mqtt->subscribe('zipcodexpress/sub');
};
$mqtt->onMessage = function($topic, $content){
echo "topic:$topic content:$content\n";
};
$mqtt->connect();
}

}

1627 1 0
1個回答

roczyl

沒找到 Workerman\Mqtt\Client 這個類
改成 \Workerman\Mqtt\Client 試試

  • zhang 2022-08-28

    解決了謝謝,$mqtt = new \Workerman\Mqtt\Client這樣寫就可以了

年代過于久遠,無法發(fā)表回答
??