适用于iOS的Amazon AWS S3 SDK断开连接(错误-1005) [英] Amazon AWS S3 SDK for iOS drops connection (Error -1005)
问题描述
运行AWSiOSDemoTVM项目时,异步S3演示代码将开始上载数据,但在几秒钟后将断开连接.
When running the AWSiOSDemoTVM project, the async S3 demo code will start uploading data, but the connection will be dropped after a couple of seconds.
AWSiOSDemoTVM:didFailWithError:错误域= NSURLErrorDomain 代码= -1005网络连接丢失." UserInfo = 0xb54e850 {NSErrorFailingURLStringKey = https://BUCKETNAME.s3.amazonaws.com/asyncDemoKey, NSErrorFailingURLKey = https://BUCKETNAME.s3.amazonaws.com/asyncDemoKey, NSLocalizedDescription =网络连接丢失. NSUnderlyingError = 0xb5527f0网络连接丢失."}
AWSiOSDemoTVM: didFailWithError : Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost."UserInfo=0xb54e850 {NSErrorFailingURLStringKey=https://BUCKETNAME.s3.amazonaws.com/asyncDemoKey, NSErrorFailingURLKey=https://BUCKETNAME.s3.amazonaws.com/asyncDemoKey, NSLocalizedDescription=The network connection was lost., NSUnderlyingError=0xb5527f0 "The network connection was lost."}
不使用异步委托的小上传将会成功.
Small uploads without using the asynchronous delegate will succeed.
推荐答案
我没有为存储桶设置正确的端点.默认端点仅适用于美式水桶.
I didn't set the correct endpoint for the bucket. The default endpoint only works for US buckets.
在AmazonClientManager.m中,为您的存储桶区域添加正确的端点.
In AmazonClientManager.m, add the correct endpoint for your bucket region.
s3 = [[AmazonS3Client alloc] initWithCredentials:credentials];
s3.endpoint = @"https://s3-eu-west-1.amazonaws.com";
可以在此处
这篇关于适用于iOS的Amazon AWS S3 SDK断开连接(错误-1005)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!