WeChat does not respond within 5 seconds. How can this problem be solved?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.