Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Issue about background and screenlock download with asihttprequest #346

Open
TinyXu opened this Issue Oct 23, 2012 · 0 comments

Comments

Projects
None yet
1 participant

TinyXu commented Oct 23, 2012

Hi!
First please forgive my poor English!
I use asi-http-request in my project to download a series of file.But when i upgrade to iOS6,I found that when i push app to background or push the 'screen-lock' button,then some files downloaded go wrong.I found that some files are different with source file.I want to know why the data downloaded is wrong?
And here are my codes:

self.queue = [[ASINetworkQueue alloc]init];
[self.queue reset];
[self.queue setDelegate:self];
[self.queue setQueueDidFinishSelector:@selector(queueHasFinished)];
[self.queue setShouldCancelAllRequestsOnFailure:NO];
[self.queue setMaxConcurrentOperationCount:1];

ASIHTTPRequest *req = [ASIHTTPRequest requestWithURL:
[req setShouldAttemptPersistentConnection:NO];
[req setTimeOutSeconds:20];
//[req setShouldContinueWhenAppEntersBackground:YES]; //no matter yes or no datas went wrong
//[req setAllowResumeForFileDownloads:YES];

        [req setNumberOfTimesToRetryOnTimeout:20];
        [req setDownloadDestinationPath:XXX
        [req setDelegate:self];


        [self.queue addOperation:req];

Thank a lot !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment