You cannot send any kind of cancel message to an NSURLRequest, your app will just crash. –Jason Coco Mar 16 '11 at 20:28 hmm, its not cancelling an NSURLRequest Disable the firewall & test again? –Raptor Oct 18 '11 at 6:48 See the answer on link below stackoverflow.com/questions/6609813/error-using-nsurlconnect‌ion –Minakshi Oct 18 '11 at 6:59 The same Im thinking: [self performSelector:@selector(cancelRequest:) withObject:myRequest afterDelay:myTimeOut]; I have a feeling this will result in disaster if somehow the request has been released, and I would have no way to determine that. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed

Have our class conform to the NSURLConnectionDelegate protocol and declare a var to store the response data 2. Using only one cpu core Questions about convolving/deconvolving with a PSF Mysterious cord running from wall. asked 3 years ago viewed 1609 times active 3 years ago Related 60NSURLConnection timeout?5iphone Json POST request to Django server creates QueryDict within QueryDict1NSXMLParser Leaks big time! In my delegates, I handle the failure, but when the site doesn't respond the delegates don't get called.

which pattern groups these sublists together What is the Japanese equivalent of "to pick up a girl" or "to hit on girls"? Questions about convolving/deconvolving with a PSF When to stop rolling a die in a game where 6 loses everything Doing laundry as a tourist in Paris Is the four minute nuclear Just spins. Is this still impossible? –Ying Mar 22 '11 at 19:39 That's not impossible, but there is no reason to block the thread.

Who you gonna call?.. I will post a code sample when I have more time. asked 4 years ago viewed 3759 times active 4 years ago Get the weekly newsletter! Should I record a bug that I discovered and patched?

which pattern groups these sublists together When to stop rolling a die in a game where 6 loses everything Nesting Parent-Child Relationship Query Criminals/hackers trick computer system into backing up all Asking for a written form filled in ALL CAPS What is the possible impact of dirtyc0w a.k.a. "dirty cow" bug? Create an instance of NSURLRequest, assign it the URL. ARTICLE CONTENTS 1.

If you need to check for stuff like response codes you can do so via the "response" variable you pass in Line 6. Join them; it only takes a minute: Sign up Handling a NSURLRequest with timeout when using delegate up vote 9 down vote favorite 3 I'm using a NSMutableURLRequest to connect to What is the possible impact of dirtyc0w a.k.a. "dirty cow" bug? any completion block? –Avijit Nagare Sep 14 at 8:04 add a comment| up vote 24 down vote Edit: This answer is now obsolete, but at the date of answering was accurate.

ios objective-c timeout nsurlconnection share|improve this question asked Feb 25 '13 at 11:13 Jeremy 659522 setTimeoutInterval should be maximum something like 60 seconds, or 60*n, where n can be In Line 5, the request will be performed synchronously and the results assigned to the NSData variable. You asked if it was possible; the answer is no. the code will be something like this: [NSURLConnection sendSynchronousRequest: req returningResponse: &response error: &error]; if (error) { UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alert show];

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Still my request is getting timed out. Performing a POST Request To POST data, all you need to do is to use NSURLRequest like we did before previously, but this time you'll set the HTTPMethod property to POST Why does >3k move the cursor up when >3j does not move it down?

That appears to be a generic error handler. –devios1 Sep 10 '13 at 21:44 12 Found it: error.code == NSURLErrorTimedOut –devios1 Sep 10 '13 at 21:46 add a comment| up Should I be implementing NSURLConnection with a delegate instead? Then we send it with NSURLConnection like before. We sent a request off to the server and never got any reply.

I find that in the large majority of times, I'm using the async request because otherwise the UI would be frozen while the synchronous request is doing its thing and that's Join them; it only takes a minute: Sign up How to detect if NSURLConnection's sendSynchronousRequest:returningResponse:error: ended up being timed out or other error up vote 2 down vote favorite 1 I Those you can easily cancel. I was aiming to treat timeout so anything else I treated as bad URL.

Nesting Parent-Child Relationship Query It is possible to find an infinite set of points in the plane where the distance between any pair is rational? D) ALL OF THE ABOVE. Reading the iPhone API docs I don't see any mention of what should happen when the timeout occurs, just that you can set the timeout value. I'm doing so by generating the request, and then using NSURLConnection with a delegate of self to handle the async connection.

Already have an account? Thesis reviewer requests update to literature review to incorporate last four years of research. Did Dumbledore steal presents and mail from Harry? An Asynchronous Example To fetch some data, we'll follow these 3 basic steps: 1.

Thanks in Advance.... –Harsha A LazyWorkaholic Oct 19 '11 at 4:45 add a comment| up vote 0 down vote If you're confident of your server-side then it may be not a Reload to refresh your session. The NSURLResponse and NSError vars are passed into the sendSynchronousReqeust method so when it returns, they will be populated with the raw response and error (if any). It looks like you're new here. Not the answer you're looking for? However with the timeout on the NSURLRequest set to 10...

In my case with a C6150, I selected C610. Oki Electric Industry Printers... Select Add. With help from Okidata customer support (whom I found very helpful), I chose a different driver. I'm also running Leopard. (Just switched from a PC.) Whenever I print through a Linksys wireless printserver I get exactly the same nettlesome response as Musicman4444. Expand Popular Questions 2 Answers Oki b431 DRUM reset Oki Electric Industry B431d... 1 Answer OKI C8600 Replace Image Drum - 563: K Dru...

Slight issue: NSHTTPPropertyStatusCodeKey is deprecated. –Johan Kool Dec 4 '09 at 19:00 3 You can use any string, for example @"Error", instead of NSHTTPPropertyStatusCodeKey –Mihir Mathuria May 20 '11 at I think you are on the right track. http status code 404 Hi @pasanpr, I am getting a valid http response but I am getting a client error 404. Check HTTP response for successful GET request if let httpResponse = response as? How do you say "a meme" in Esperanto? Meanwhile,...

Cache Policies 1. share|improve this answer edited Nov 12 '12 at 16:14 Mat 1,02332040 answered Aug 10 '09 at 4:51 Sandeep Kumar 7251719 add a comment| up vote 0 down vote What I did The connection is succeeding because the server is, in fact, returning data, just not the data you were expecting. share|improve this answer answered Feb 12 '15 at 10:17 Luchini 314 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign What one can do if bos...