用TP6的框架和workerman异步从第三方网站获取链接,但是,在启动几分钟后就会自动停掉,也没有调用onClose方法。
gateway_worker配置
// BusinsessWorker配置
'businessWorker' => [
'name' => 'BusinessWorker',
'count' => 1,
'eventHandler' => '\app\push\controller\Events',
],
class Events extends PushController
{
public static function onWorkerStart($worker)
{
// 异步建立一个连接
$con = new AsyncTcpConnection(sysconfig('api', 'test_api'));
$con->transport = 'ssl';
$con->onConnect = function ($con) {
Log::error('onConnect');
\app\push\controller\Test::onAsyncConnect($con);
};
$con->onMessage = function ($con, $message) use($worker) {
Log::error('onMessage');
\app\push\controller\Test::onAsyncMessage($con, $message, $worker);
};
$con->onClose = function ($con) {
// 如果连接断开,则在1秒后重连
Log::error('reConnect');
Timer::add(5, array($con, 'connect'), null, false);
$con->reConnect(1);
};
$con->onError = function ($con, $code, $msg) {
//错误的通知处理
Log::error('error:'.$msg);
};
// 执行异步连接
$con->connect();
}
}
linux,TP6,workerman
debug方式运行看下报错,ffphp进程一直在退出,3个小时退出了12658次
确实有报错。worker[ffphp:12729] exit with status 64000
Workerman[think] has been stopped
这个要怎么看哪里的错误呢?
https://www.workerman.net/q/4024