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 ..