cancel a ASIHTTPRequest thread
- by user262325
Hello evryone
I have some codes to use ASINetworkQueue as multi thread download
ASINetworkQueue *networkQueue;
[networkQueue setDelegate:self];
[networkQueue setRequestDidFinishSelector:@selector(requestDone:)];
[networkQueue setShowAccurateProgress:true];
NSURL *url = [NSURL URLWithString:s];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDownloadProgressDelegate:a];
[request setTag:index];
[request setTimeOutSeconds:10];
[request setDelegate:self];
[networkQueue addOperation:request];
[networkQueue go];
if I try to use the code below to cancel the thread with index k
[[[networkQueue operations] objectAtIndex:k] cancel];
I notice all requests in ASINetworkQueue were cancelled and stop working.
Welcome any comment
Thanks
interdev