I have recently upgraded my flutter version in my app. But when I want to debug the application, it shows me the following error.
Error connecting to the service prot
I figured out how to limit the connections on the underlying HttpClient of NetworkImage!
I globally overrode the HttpClient: (ref: Override HttpClient globally)
class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext context) {
return super.createHttpClient(context)
..maxConnectionsPerHost = 5;
}
}
void main() {
HttpOverrides.global = MyHttpOverrides();
runApp(MyApp());
}
Ref : Connection closed...