Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: SocketException: Failed host lookup: 'xxx.com' (OS Error: nodename nor servname provided, or not known, errno = 7) #2290

Closed
gitwangyang opened this issue Sep 11, 2024 · 1 comment

Comments

@gitwangyang
Copy link

gitwangyang commented Sep 11, 2024

Package

dio

Version

5.7.0

Operating-System

Android, iOS

Adapter

Default Dio

Output of flutter doctor -v

No response

Dart Version

3.5.0

Steps to Reproduce

import 'package:dio/dio.dart';

void main() async {
Dio dio = Dio();

// 创建多个请求的Future列表
List<Future> futures = [];

// 添加请求到futures列表
for (int i = 0; i < 10; i++) {
futures.add(dio.get('https://api.example.com/data$i'));
}

// 使用Future.wait并发执行所有请求
try {
List responses = await Future.wait(futures);
// 处理所有响应
for (Response response in responses) {
print(response.data);
}
} catch (e) {
print(e);
}
}

Expected Result

no erro

Actual Result

SocketException: Failed host lookup: 'xxx.com' (OS Error: nodename nor servname provided, or not known, errno = 7)

@gitwangyang gitwangyang added h: need triage This issue needs to be categorized s: bug Something isn't working labels Sep 11, 2024
@AlexV525
Copy link
Member

与库无关,检查网络权限及网络状况。

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
@AlexV525 AlexV525 added i: not related and removed h: need triage This issue needs to be categorized s: bug Something isn't working labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants