dio icon indicating copy to clipboard operation
dio copied to clipboard

'DioError [DioErrorType.connectTimeout]: Connecting timed out [20000ms]'

Open OHeroJ opened this issue 2 years ago • 5 comments

报错量非常多,咋整?

CONNECT_TIMEOUT too many times。

used package Dio 4.0.4, but still the same.

OHeroJ avatar Mar 22 '22 06:03 OHeroJ

https://github.com/flutterchina/dio/issues/975

OHeroJ avatar Mar 22 '22 06:03 OHeroJ

any updates?

balaji101010 avatar Apr 25 '22 07:04 balaji101010

Same here sometime this timeout error appear internet is good why?

heinzan avatar Jul 08 '22 03:07 heinzan

Same here sometime this timeout error appear internet is good too pls help

toppert avatar Aug 02 '22 08:08 toppert

I temporarily used this library to fix my api issues https://pub.dev/packages/retry whenever there is timeout

balaji101010 avatar Aug 02 '22 11:08 balaji101010

@balaji101010 how did you implement this package? I only want to retry on Dio Timeout, in all other cases it should be handled by the _handleException method. I doubt if I need to await the .get method? I assume it's not needed, in the source code of the package I see the fn will be awaited.

    try {
      return await retry(
        () => _getHttpClient().get(url, queryParameters: queryParameters),
        maxAttempts: 3,
        retryIf: (e) => e is DioError && e.type == DioErrorType.connectTimeout,
      );
    } catch (e) {
      _handleException(e);
    }

gerritwitkamp avatar Oct 11 '22 06:10 gerritwitkamp

一直有这个问题

a83988029 avatar Jun 12 '23 02:06 a83988029