NSMutableURLRequest not obeying my timeoutInterval
        Posted  
        
            by kubi
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by kubi
        
        
        
        Published on 2010-04-29T11:46:15Z
        Indexed on 
            2010/04/29
            13:17 UTC
        
        
        Read the original article
        Hit count: 643
        
I'm POST'ing a small image, so i'd like the timeout interval to be short. If the image doesn't send in a few seconds, it's probably never going to send. For some unknown reason my NSURLConnection is never failing, no matter how short I set the timeoutInterval. 
// Create the URL request
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] 
                                 initWithURL:[NSURL URLWithString:@"http://www.tumblr.com/api/write"]
                                 cachePolicy:NSURLRequestUseProtocolCachePolicy
                                 timeoutInterval:0.00000001];
/* Populate the request, this part works fine */
[NSURLConnection connectionWithRequest:request delegate:self];
I have a breakpoint set on - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error but it's never being triggered. My images continue to be posted just fine, they're showing up on Tumblr despite the tiny timeoutInterval.
© Stack Overflow or respective owner