use think\Exception;function __construct (\think\Request $request = NULL)
{
parent::__construct ($request);
try {
Gateway::$registerAddress = config ("CHAT2") . ":1236";
} catch (Exception $e) {
die("系统服务未正常启动,请联系系统管理员!");
}
}我用的thinkphp的Exception类,但是这个捕获不到异常报错代码来自workerman提供的gateway类,原因是服务器服务没开启报的错
$client = stream_socket_client ('tcp://' . self::$registerAddress, $errno, $errmsg, self::$connectTimeout);报错信息[2] ErrorException in Gateway.php line 874
stream_socket_client(): unable to connect to tcp://127.0.0.1:1236 (Connection refused) 最佳答案