AsyncTcpConnection 链接后是否成功,怎么查看数据

canlandefeng

$worker = new Worker();

$worker->onWorkerStart = function($worker){

// 发起异步连接
$con = new AsyncTcpConnection('ws://api.huobi.pro/ws');

// 设置以ssl加密方式访问
$con->transport = 'ssl';

$con->onConnect = function(AsyncTcpConnection $con) {
    file_put_contents('./4596.txt',132);
    $con->send('hello');
};

$con->onMessage = function(AsyncTcpConnection $con, $data) {
    echo $data;
};

$con->connect();

};

启动 wokerman 后没有信息,也不知道怎么样
php start.php start -d
也没有任何返回,怎么知道是否链接到火币的wss成功没

375 1 0
1个回答

SillyDog

写日志 然后看日志文件
https://www.workerman.net/doc/webman/log.html

  • 暂无评论
×
🔝