dongshan4878 2016-11-16 21:48
浏览 58
已采纳

PHP的curl_reset()是否关闭底层连接?

I am doing many curl requests to the same server in a loop.

I want to keep using the same curl handle, as this is much faster than closing it with curl_close() and getting a new one using curl_init() as it keeps the underlying connection open. Reusing the handle is definitely faster.

If I call curl_reset() after each request, will this reset the connection and therefore slow down?

  • 写回答

1条回答 默认 最新

  • doureng6738 2016-11-16 21:55
    关注

    No. The curl_reset engine code calls the libcurl method curl_easy_reset whose documentation explicitly states:

    ... does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies and shares.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 (SQL语句|查询结果翻了4倍)
  • ¥15 Odoo17操作下面代码的模块时出现没有'读取'来访问
  • ¥50 .net core 并发调用接口问题
  • ¥15 网上各种方法试过了,pip还是无法使用
  • ¥15 用verilog实现tanh函数和softplus函数
  • ¥15 Hadoop集群部署启动Hadoop时碰到问题
  • ¥15 求京东批量付款能替代天诚
  • ¥15 slaris 系统断电后,重新开机后一直自动重启
  • ¥15 QTableWidget重绘程序崩溃
  • ¥15 谁能帮我看看这拒稿理由啥意思啊阿啊