Data Uploading stop when i locked the screen of device
<p>I am uploading video files on server using AFNetworking it is working fine in background mode and when application is in foreground but when i locked the screen it stoped uploading and does not give any error and go to compltion handler.
Here is the code</p>

<pre><code> AFURLConnectionOperation *operation =   [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setUploadProgressBlock:^(NSUInteger __unused bytesWritten,
                                    long long totalBytesWritten,
                                    long long totalBytesExpectedToWrite) {
    NSLog(@"Wrote Data %lld/%lld", totalBytesWritten, totalBytesExpectedToWrite);
    [self setProgress:(float)totalBytesWritten/(float)totalBytesExpectedToWrite];
}];

typeof(operation) __weak weakOperation = operation;
[operation setCompletionBlock:^{
    if([weakOperation isFinished]) {  
        [SVProgressHUD showSuccessWithStatus:DISCUSSION_SAVE_SUCCESS];
    } else {
        [SVProgressHUD showErrorWithStatus:ERROR];

    }
}];

[operation start];
</code></pre>