flutter - 下载大文件时连接关闭
问题描述
我正在尝试使用 DIO 在 Flutter 应用程序中下载一个大文件(1.5-3GB)。在调试版本中一切都很好,但在发布时我会随机出现连接中断:DioError [DioErrorType.DEFAULT]:HttpException:接收数据时连接关闭,uri = https://unitedrp.ru/files/10475-GTA-SanAndreas -v1-06-cache.zip
在 flutter_downloader 插件中我有同样的错误。HttpClient导致应用程序崩溃没有解释
await GetIt.I.get<Dio>().download(
link,
path,
onReceiveProgress: (receive,total) => onProgress(((receive/total)*100).toInt()));
解决方案
推荐阅读
- javascript - Next.js 9.3+ 和包罗万象的路线
- node.js - 保存 JSON 数据时出错 - NodeJS Express
- stripe-payments - 条纹,从客户转移到我们的帐户
- python - 为什么 SQL 会插入不正确的值?
- windows - Windows 应用程序的内存消耗
- f# - f# canopy 中的按钮扩展
- amazon-s3 - 找不到查询参数时如何重定向或阻止云端 URL
- sql - 使用 CASE 将附加列组合成一行?
- html - Ajax 为项目中的数据请求 API
- c++ - 使用变换矩阵时,如何将方向和缩放从全局参考系转换为局部参考系?