dio icon indicating copy to clipboard operation
dio copied to clipboard

CONNECT_TIMEOUT too many times

Open asiaWang opened this issue 6 years ago • 30 comments

when i request a url,CONNECT_TIMEOUT happened too many times,can you help me to solve this issue?

I/flutter ( 7221): DioError [DioErrorType.CONNECT_TIMEOUT]: Connecting timed out [5000ms] I/flutter ( 7221): E/flutter ( 7221): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: DioError [DioErrorType.CONNECT_TIMEOUT]: Connecting timed out [5000ms] E/flutter ( 7221): #0 DioMixin._request._errorInterceptorWrapper... (package:dio/src/dio.dart:870:17) E/flutter ( 7221): #1 _rootRunUnary (dart:async/zone.dart:1198:47) E/flutter ( 7221): #2 _CustomZone.runUnary (dart:async/zone.dart:1100:19) E/flutter ( 7221): #3 _FutureListener.handleValue (dart:async/future_impl.dart:143:18) E/flutter ( 7221): #4 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45) E/flutter ( 7221): #5 Future._propagateToListeners (dart:async/future_impl.dart:725:32) E/flutter ( 7221): #6 Future._completeWithValue (dart:async/future_impl.dart:529:5) E/flutter ( 7221): #7 Future._asyncCompleteWithValue. (dart:async/future_impl.dart:567:7) E/flutter ( 7221): #8 _rootRun (dart:async/zone.dart:1190:13) E/flutter ( 7221): #9 _CustomZone.run (dart:async/zone.dart:1093:19) E/flutter ( 7221): #10 _CustomZone.runGuarded (dart:async/zone.dart:997:7) E/flutter ( 7221): #11 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23) E/flutter ( 7221): #12 _microtaskLoop (dart:async/schedule_microtask.dart:41:21) E/flutter ( 7221): #13 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

asiaWang avatar Oct 23 '20 09:10 asiaWang

I have same problem. When upload files this problem happens many times.

Josephchen-crypto avatar Oct 25 '20 10:10 Josephchen-crypto

TIMEOUT usually a network problem, please check whether network permissions have been added

wozhizhizhi avatar Oct 29 '20 02:10 wozhizhizhi

I have same problem.Check to make sure the network is ok, as is the native interface.

sj1910 avatar Nov 12 '20 05:11 sj1910

I confirm, this happens to me as well. In my case I observe this behavior if I fire several calls at the same time. 3-4 calls will make sure that I will get SocketTimeoutError. Then if I do polling too often (1 sec vs 5 sec) I observe this behavior as well.

Defuera avatar Nov 18 '20 12:11 Defuera

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

stale[bot] avatar Dec 19 '20 06:12 stale[bot]

This is still an issue.

luandnguyen avatar Jan 25 '21 17:01 luandnguyen

This issue is still happening!

lisimmo avatar Jan 25 '21 18:01 lisimmo

This issue is still happening!

nEdAy avatar Jan 28 '21 02:01 nEdAy

This happens randomly when uploading files on 3.0.9 and 3.0.10

spiritinlife avatar Feb 02 '21 18:02 spiritinlife

Im also facing the challenge, somebody help??/

brunoalfred avatar Jun 09 '21 06:06 brunoalfred

same problem

a83988029 avatar Jul 10 '21 04:07 a83988029

same problem too

catmaomao avatar Jul 26 '21 08:07 catmaomao

Same problem, just randomly

koteesy avatar Aug 17 '21 10:08 koteesy

same

chloe722 avatar Oct 14 '21 10:10 chloe722

same issue

yemidada avatar Nov 02 '21 21:11 yemidada

Me too, i used package Dio 4.0.4, but still the same.

This issue appear when running debug mode, but run profile mode isn't have issue.

Sometimes i uninstall app and run debug mode , everything ok.

thedang avatar Nov 26 '21 11:11 thedang

I also have this issue. It should not be closed

tamoyal avatar Dec 12 '21 18:12 tamoyal

same issue, but it appeared in release mode

HuberyYang avatar Jan 25 '22 12:01 HuberyYang

Apps running on mobile devices suffer from unstable network conditions, since the user can be moving around while using the app. For example, the user can enter an elevator, go underground, or just enter a zone of bad reception. This can cause connection timeouts, which are not caused by Dio. Your app should be able to handle timeouts of any request.

jgoyvaerts avatar Jan 25 '22 12:01 jgoyvaerts

same here

Calvin2274 avatar Apr 01 '22 12:04 Calvin2274