Network timeout and network timeout

Source: Internet
Author: User
Tags website server

Network timeout and network timeout
Network timeout written by Wu xueying

NSHTTPURLResponse * response = nil; NSError * error = nil; NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: url]; request. timeoutInterval = 15; request. HTTPMethod = @ "POST"; NSData * respData = [NSURLConnection sendSynchronousRequest: request returningResponse: & response error: & error]; if (error) {NSLog (@ "error "); [ZAActivityBar showErrorWithStatus: @ "Network unava Ilabel! Please try again! "];}



What is network timeout?

Network Connection timeout means that the server does not respond within the default wait time of the program,
There may be many reasons for network connection timeout
1. The network is disconnected, but it is often displayed as unable to connect.
2. network congestion. As a result, you cannot get a response packet within the default wait time of the program.
3. The network is unstable and server information cannot be completely transmitted.
4 system: system resources are too low to provide sufficient resources for programs to process server information

Network timeout

During programming, the programmer sets the connection time in the program. If a task is not completed within the time range, the system prompts "Network timeout ". Network timeout is generally caused by slow network speed, or a network connection failure. If the webpage is opened, it may also be caused by a problem on the website server ..

Related Article

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.