facing socket exception in flutter(warning in console),error no-111 - flutter

I am trying to enter into my flutter app and it is showing this error,infact api is also working fine and getting the right response.but still facing
SocketException: OS Error: Connection refused, errno = 111, address = "", port = 50000

Related

Exception caught by image resource service OS Error: Connection refused, errno = 111, address = localhost, port = 56460

shows me this error when I connected my flutter app to localhost database when I click to images in my app then shows me this error and my images is not able to loaded in my flutter app

Flutter Unhandled Exception: SocketException: OS Error: Broken pipe, errno = 32, address = 10.0.2.2, port = 51420

I am using Flutter with Flask at back end. I want to send an image from flutter to Flask for processing.
enter image description here
But I am getting this error in Android studio:
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: SocketException: OS Error: Broken pipe, errno = 32, address = 10.0.2.2, port = 51420
My flask terminal says:
127.0.0.1 - - [11/May/2021 23:07:56] "←[37mPOST / HTTP/1.1←[0m" 200 -
Your server process has received a SIGPIPE writing to a socket. This usually happens when you write to a socket fully closed on the other (client) side. This might be happening when a client program doesn't wait till all the data from the server is received and simply closes a socket (using close function).
In a C program you would normally try setting to ignore SIGPIPE signal or setting a dummy signal handler for it. In this case a simple error will be returned when writing to a closed socket. In your case a python seems to throw an exception that can be handled as a premature disconnect of the client.

Flutter NTP Package , IOS ISSUE

i am using the ntp function , to get the real time ,
await NTP.now();
and i got this exception on ios device , but the same function work fine on android !
SocketException: OS Error: Connection reset by peer, errno = 54, address = dns.google.com, port = 53945
any idea what is wrong ? thanks

problem with flutter and mongodb connection

import 'package:mongo_dart/mongo_dart.dart';
main() async{
Db db = new Db("mongodb://localhost:27017/workouts");
await db.open();
print("success ---------------------------------");
}
this symple code and dont connect, i dont know why.
this is the output:
Syncing files to device Android SDK built for x86...
Restarted application in 306ms.
E/flutter ( 5415): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 52206
E/flutter ( 5415): #0 _ConnectionManager._connect (package:mongo_dart/src/network/connection_manager.dart:23:5)
....
and more logs
¿some help? :(
solved ==> https://stackoverflow.com/a/55786011/12369361
due to use emulator I need to use 10.0.2.2 instead of localhost
I suppose that you have a local mongoDB server. If it is the case, you have to connect your local server and your android phone to the same network (through wifi).
Then get the IP of your local server and replacing localhost in your url with the IP you found.
If you can't, it is possible that your firewall is blocking your requests.

Flutter - Unhandled Exception: SocketException:

I am facing below error while accessing the web services in android app. But its working fine in iOS app.Pl help us to resolve this issue
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 47992
Also I have faced the same problem.
The way I have solved my problem is,
I made sure that there is no error in my code. Then I uninstalled my app, after that I restarted my phone and install the app again. Then it start working.
I hope this will help..