我正在发送 curl.opts 设置为的 curlPerform
curl.opts = curlOptions(
httpheader = c(
'Content-Type' = "application/x-www-form-urlencoded; charset=UTF-8",
'Accept' = "application/json"
),
verbose = FALSE,
header = TRUE,
useragent = "RCurl"
)
我最终得到错误“无法连接到 192.168.141.136:没有缓冲区空间”。我需要连续运行这个程序好几天,但这会在大约 6 分钟后发生。有没有办法将缓冲区最大值设置得更高?或者,有没有办法查看剩余多少“缓冲空间”?如果是这样,我可以将其设置为重新启动 R 并恢复程序。请注意,如果程序运行一段时间,停止,然后我手动重新启动它,就会发生这种情况。“缓冲区”永远不会被清除。我发现清除它的唯一方法是重新启动 R。
如果有帮助,我也会失去与 Rstudio 的“连接”,即使我只是使用单独的 R 窗口执行此操作,并且在收到此错误后我也会失去与互联网的连接,直到我关闭 R
编辑:这是 traceback() 的部分结果(其余的都不是问题)
11: fun(structure(list(message = msg, call = sys.call()), class = c(typeName,
"GenericCurlError", "error", "condition")))
10: function (type, msg, asError = TRUE)
{
if (!is.character(type)) {
i = match(type, CURLcodeValues)
typeName = if (is.na(i))
character()
else names(CURLcodeValues)[i]
}
typeName = gsub("^CURLE_", "", typeName)
fun = (if (asError)
stop
else warning)
fun(structure(list(message = msg, call = sys.call()), class = c(typeName,
"GenericCurlError", "error", "condition")))
}(7L, "Failed to connect to 192.168.141.136: No buffer space",
TRUE)
9: .Call("R_curl_easy_perform", curl, .opts, isProtected, .encoding,
PACKAGE = "RCurl")
8: curlPerform(url = "http://gt-tradeview/House/TradeView/ajax/varys",
postfields = mkURL(parameters), .opts = curl.opts, writefunction = r$update,
post = 1L, curl = r$curl()) at functiondefinitionsLive.R#211
7: value[[3L]](cond)
6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)