云服务器是正常判断,此终端掉线
终端在超时15分钟左右,自动重连了
而不是直接就知道掉线,像是挂起一样,困惑许久,外网正常
public static function onWorkerStart($worker)
{
$connection_to_yun = new AsyncTcpConnection(ws:x.xxx.com:8888);
$connection_to_yun->transport = 'ssl';
$connection_to_yun->onConnect = ['Events', 'yun_onConnect'];
$connection_to_yun->onMessage = ['Events', 'yun_onMessage'];
$connection_to_yun->onClose = ['Events', 'yun_onClose'];
$connection_to_yun->onError = ['Events', 'yun_onError'];
$connection_to_yun->connect();
}
public static function yun_onClose($connection)
{
$connection->reConnect(1);
}
public static function yun_onError($connection, $code, $msg)
{
echo 'yun_onError: Error code:' . $code . ' msg:' . $msg . '\n';
}
请大佬,指点下,感谢万分