gpt4 book ai didi

php - php curl 是否有一个选项来检查它是否是一个初始连接或者这个连接是否被重用?

转载 作者:太空宇宙 更新时间:2023-11-03 12:58:44 26 4
gpt4 key购买 nike

我正在尝试检查 https 连接是否为初始连接,或者我是否重复使用了:

$curlHandle = curl_init(); //first connection
$url = "https://en.wikipedia.org/wiki/Main_Page";
curl_setopt($curlHandle, CURLOPT_URL, $url);
//Reused the handle
$url = "https://en.wikipedia.org/wiki/Curl";
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_close($curlHandle);//finally closed

如何检查(不使用 wireshark)?有没有 php curl 选项可以看到这个?

提前致谢。

最佳答案

不,没有。 cURL-Handle 不保存任何相关信息。它只是立即检查是否有当前使用的并返回它的 handle 。出于性能原因,就是这样。

关于php - php curl 是否有一个选项来检查它是否是一个初始连接或者这个连接是否被重用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48185920/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com