Received and returned after remote data processing is captured through curl, but with a limit of 5 seconds, {code...} is set ...} after five seconds, no message is returned. How can this problem be solved? Ps: the default value of CURLOPT_TIMEOUT is several seconds. Does it mean the time for processing the complete request? After receiving the sent information, capture the remote data processing through curl and return it, but there is a limit of 5 seconds
Curl_setopt ($ ch, CURLOPT_TIMEOUT, 5 );
After five seconds, no message is returned. How can this problem be solved?
Ps: the default value of CURLOPT_TIMEOUT is several seconds. Does it mean the time for processing the complete request?
Reply content:
After receiving the sent information, capture the remote data processing through curl and return it, but there is a limit of 5 seconds
Curl_setopt ($ ch, CURLOPT_TIMEOUT, 5 );
After five seconds, no message is returned. How can this problem be solved?
Ps: the default value of CURLOPT_TIMEOUT is several seconds. Does it mean the time for processing the complete request?
Setting is useless because the server is disconnected if no data is received within five seconds.
I want to set the timeout for capturing remote data to less than 5 s, for example, 2 s. If the time for capturing remote data exceeds the timeout value. Make a fault tolerance process, because if you do not spit out the information within five seconds, the user will not receive anything.
Write asynchronous call. Upon receiving the message, the system immediately responds, Asynchronously processes the specific logic, and then sends feedback through the customer service message.