如何写精华回答,获更多曝光?
发布
function preConnectStreams(num: number, urls: Array<string>): number;
C++
napi_value PreConnectStreams(napi_env env, napi_callback_info info) {
napi_value result;
size_t argc = 2;
napi_value args[2] = {nullptr};
napi_get_cb_info(env, info, &argc, args, nullptr, nullptr);
if (argc != 2) {
HILOGI("param count(%{public}zu) check fail.", argc);
napi_create_int32(env, Cronet_RESULT_ILLEGAL_ARGUMENT, &result);
return result;
}
int num;
napi_get_value_int32(env, args[1], &num);
//todo 这里的数组应该如何获取呢
}