我想在s3 sdk 2.0 iOS中设置超时属性。在以前的版本,如果找到超时属性,但以前的版本不自动处理时间偏差问题,所以我使用新的sdk但问题是我无法找到timout类型属性。任何机构都可以告诉我如何设置超时或连接超时属性。 我只想在特定时间后停止上传任务但不使用计时器,我想使用像NSMutableRequest这样的属性有conncetiontimeout属性
AWSS3TransferManager *transferManager = [AWSS3TransferManager defaultS3TransferManager];
AWSS3TransferManagerUploadRequest *uploadRequest = [AWSS3TransferManagerUploadRequest new];
uploadRequest.bucket = [Constants pictureBucket];
uploadRequest.key = imageName;
uploadRequest.body = fileUrl;
uploadRequest.contentType = isPNG ? @"image/png" : @"image/jpeg";
//uploadRequest.contentLength = [NSNumber numberWithUnsignedLongLong:imageData.length];
[[transferManager upload:uploadRequest] continueWithBlock:^id(BFTask *task) {
BOOL isError = (task.error == nil) ? NO : YES;
NSLog(@"response %@",task.error);
if (!isError && task.isCompleted)
{
NSLog(@"success");
}
else
{
NSLog(@"failure"); }
return task;
}];