Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IdTCPClient on Android: Connecting to non-active network
#15
(05-10-2018, 05:12 PM)BartKindt Wrote: I managed to get your new code to work, but I still cannot get connected to the WIFI network, when the Android 'Active Network' is set to MOBILE.

I don't know what else to tell you then. Maybe Android is just not physically connected to the WiFi when it is connected to the Mobile network? I'm not an Android expert. There are only so many options available to tell the low-level POSIX socket API which network to use, and we have pretty much exhausted them at this point.

The only thing I have left to suggest is to not use Indy at all, but use Android's own Socket API instead. The Network.bindSocket() method can bind a Socket to a specific network. Or, you can create a Socket on a specific network using the Network.getSocketFactory() and SocketFactory.createSocket() methods.

(05-10-2018, 05:12 PM)BartKindt Wrote: Can you please explain to me how Indy knows to which of the two networks to connect all by itself?

Indy doesn't pick either one. If you don't explicitly bind the socket to a specific local IP or device name before the socket connection is attempted, the OS picks the appropriate network while connecting the socket to the target host/IP. It picks that network based on available network routes.

(05-10-2018, 05:12 PM)BartKindt Wrote: But Indy automatically select the one which Android has set to the 'Active Network'.

Indy is not the one making that decision, Android/Linux itself is.

Reply


Messages In This Thread
RE: IdTCPClient on Android: Connecting to non-active network - by rlebeau - 05-10-2018, 07:07 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)