libcurl卡在POLLIN超时中

Aks*_*Aks 6 php curl

我的php代码中的libcurl似乎无限期地停留在一个poll调用中.当我对进程id做了一个strace,

[user@server ~]$ sudo strace -p 19559
Process 19559 attached - interrupt to quit
poll([{fd=7, events=POLLIN}], 1, 1000)  = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0)     = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000)  = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0)     = 0 (Timeout) 
poll([{fd=7, events=POLLIN}], 1, 1000)  = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0)     = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000)  = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0)     = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000)  = 0 (Timeout)
Run Code Online (Sandbox Code Playgroud)

这无限期地持续下去.fd 7在/ proc/19559/fd中显示为

lrwx------ 1 root root 64 Sep 19 19:44 7 -> socket:[335178801]
Run Code Online (Sandbox Code Playgroud)

有人能告诉我为什么会这样.我可以做些什么来使libcurl在超时时退出

J0H*_*0HN 6

curl_setoptCURLOPT_CONNECTTIMEOUT如果设置为非零值,则选项将在超时时使curl失败.