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

dio-2.0.20,连接服务器之后,如果服务器端不做响应就会一直卡着,设置receiveTimeout不起作用 #211

Closed
sintrb opened this issue Mar 8, 2019 · 2 comments

Comments

@sintrb
Copy link

sintrb commented Mar 8, 2019

好像还是不行,用nc在8080端口跑一个服务不对客户端请求做任何响应(nc -lk 8080),但也不关闭连接,dio就卡在那里了。

import 'package:dio/dio.dart';

void main() async {
  var url = 'http://127.0.0.1:8080';
  print('start');
  Dio dio = new Dio(BaseOptions(connectTimeout: 50, receiveTimeout: 50));
  dio.head(url).then((response) {
    print(response);
  }).catchError((error) {
    print('$error');
  });
}

图片

@wendux wendux closed this as completed in 59a49e0 Mar 8, 2019
@wendux
Copy link
Contributor

wendux commented Mar 8, 2019

fixed in 2.0.21

@sintrb
Copy link
Author

sintrb commented Mar 12, 2019

thx

wendux pushed a commit that referenced this issue May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants