When using the Socket.connect from dart:io package, I can successfully connect to an ip:port that is serving an app in NETWORK A.
The problem:
If I am not in that specific network (NETWORK A) when the app starts, and instead I connect to it after app start (change the wifi from NETWORK B to NETWORK A), then the Socket connection fails.
Code Example:
Socket.connect(host, port, timeout: timeout).then((socket) {
print("Success!");
}).onError((e) => print("Failure"));
Env:
- Flutter 3.16.5
- Dart 3.2.3
- DevTools 2.28.4