Objective c AmazonServiceRequestDelegate函数失败,ServiceException给出“我”;“请求超时”;错误

Objective c AmazonServiceRequestDelegate函数失败,ServiceException给出“我”;“请求超时”;错误,objective-c,amazon-s3,delegates,Objective C,Amazon S3,Delegates,我正在使用AWSS3将我的媒体上传到亚马逊。 我就是这样做的: Bool uploaded = NO; dispatch_async("my.queue.whatever", ^{ NSData *mediaData = UIImagePNGRepresentation(mediaImage);//mediaImage of type uiimage NSString *pictureName = @"randomstring"; AmazonCredentials *am

我正在使用AWSS3将我的媒体上传到亚马逊。 我就是这样做的:

Bool uploaded = NO;
dispatch_async("my.queue.whatever", ^{

   NSData *mediaData = UIImagePNGRepresentation(mediaImage);//mediaImage of type uiimage
   NSString *pictureName = @"randomstring";

   AmazonCredentials *amazonCredentials = [[AmazonCredentials alloc] initWithAccessKey:@"myAccessKey" withSecretKey:@"mySecretKey" withSecurityToken:@"mySessionToken"];
    AmazonS3Client *s3Client = [[AmazonS3Client alloc] initWithCredentials:amazonCredentials];


    S3PutObjectRequest *s3Request = [[S3PutObjectRequest alloc] initWithKey:pictureName inBucket:@"myPictureBucket"];
    s3Request.delegate = self;
    //s3Request.contentType = CONTENT_TYPE;
    s3Request.cannedACL = [S3CannedACL publicRead];
    s3Request.data = mediaData;
    [s3Client putObject:s3Request];

    do {
        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate   distantFuture]];
    } while (!uploaded);
);
以下是我的委托功能:

-(void)request:(AmazonServiceRequest *)request didCompleteWithResponse:(AmazonServiceResponse *)response
{
    uploaded = YES;
}

-(void)request:(AmazonServiceRequest *)request didFailWithError:(NSError *)error{
    uploaded = YES;
}
- (void)request:(AmazonServiceRequest *)request didFailWithServiceException:(NSException *)exception{
    NSLog(@"didFailWithServiceException %@",[exception description]);
    uploaded = YES;
}
- (void)request:(AmazonServiceRequest *)request didSendData:(long long)bytesWritten totalBytesWritten:(long long)totalBytesWritten totalBytesExpectedToWrite:(long long)totalBytesExpectedToWrite{}

-(void)request:(AmazonServiceRequest *)request didReceiveResponse:(NSURLResponse *)response{}
-(void)request:(AmazonServiceRequest *)request didReceiveData:(NSData *)data{}

当调用函数didFailWithServiceException时,它给出错误:“请求超时”。我在谷歌上找不到任何东西。需要你的帮助!!谢谢尝试增加默认超时时间:

s3Client.timeout = desiredtimeout;
我正在试验上载操作的一些问题,它开始上载,但几秒钟后代理不再被调用

request: didSendData: totalBytesWritten: totalBytesExpectedToWrite:
我不知道框架或Amazon服务器中是否存在一些bug,或者这只是我代码中的一些bug