-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Random SocketException
s: Connection refused / Failed host lookup
#2304
Comments
Is this also happening with other implementations? Such as dart:io HttpClient and http Request |
Can't really tell unless we swap out our implementation to http and deploy to our users |
There should be nothing related to Dio AFAICT. |
I can confirm this issue happening in release. Usually starts after device goes to sleep. |
@ziarehmank Can you provide a reproducible example and an use case? |
@AlexV525 If I could reproduce it, I would debug the issue myself. But it only happens in release mode. |
Failed to lookup host and Connection refused should be nothing related to the library itself. However, swapping a new adapter might be helpful in this case. |
I have noticed this as well but have not found the time to reproduce. |
SocketException
s: Connection refused / Failed host lookup
The only thing I can tell is I got tons of these in our Crashlytics too, but those issues occurred even when using only |
I am using custom http client. Will this effect the library?.
|
All libraries that based on HttpClient should meet the same issue, which includes package:http. |
@AlexV525 you are right, still happening with http. |
Closing based on the above threads. |
Package
dio
Version
5.7.0
Operating-System
Android, iOS
Adapter
Default Dio
Output of
flutter doctor -v
No response
Dart Version
3.5.3
Steps to Reproduce
This issue has been happening since we've updated to Flutter 3.24.0. We've received numerous reports from our users that the app is throwing errors when fetching from the backend.
In our app, we rely on 2 Dio clients which calls 2 different base urls, v1 and v2.
From the error logs shown from the users, calls made to v1 is working well but calls made to v2 always throws either:
What I can confirm is that there is indeed internet connection established since concurrently, calls made to v1 was successful but for some reason, calls made to v2 fails. So this has nothing to do with network permissions and network status. Something in the library is somehow not allowing access to our v2 api even though access to v1 is fine.
Expected Result
Should not throw socket exception when making the call to v2
Actual Result
The text was updated successfully, but these errors were encountered: