biner88 / mysql_utils

Flutter mysql_client plugin helper, Use mysql_client easily.
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

Turn airplane mode on then turn it off , turn wifi off and turn cellular on -> broken function connect() #20

Open hhsang opened 9 months ago

hhsang commented 9 months ago
  1. wifi working fine both android and ios
  2. Cellular data fine on android but iOS 50% when I turn airplane mode on then off then turn cellular on (Wifi 100% off) I receive error: SocketException: Connection failed (OS Error: Network is unreachable, errno = 51), address = 11.111.222.33, port = 3306.
  3. Flutter 3.16.9 and I build minimum iOS >= 13.
biner88 commented 9 months ago

This error is caused by the socket connection not being closed properly. It is a problem with Dart's underlying code. I recommend detecting a no-network state and actively closing the MySQL connection. Or use try catch?

hhsang commented 9 months ago

This error is caused by the socket connection not being closed properly. It is a problem with Dart's underlying code. I recommend detecting a no-network state and actively closing the MySQL connection. Or use try catch?

Yes, I have detecting network, till working and I try call api json holder to test and return status 200 with correct response.

hhsang commented 9 months ago

If the app connect success no issue when I using app , and if it had problem about connect the app same dead (Although I restart devices) only working when I turn on/off airplane mode and turn on Cellular again.