Jump to content
John van de Waeter

Switching network, ipv4 and ipv6, Indy

Recommended Posts

Hi All,

 

When a user goes outdoor with his phone, network-connections may switch from WiFi to Mobile data.

 

There's no problem when both networks are ipv4 or ipv6, but sometimes the WiFi is ipv6 and the Mobile data connection is ipv4, or vice versa.

In that case, putting a hostname (in idUDPclient or idHttp) between square brackets (coming from ipv6) results in a "connection refused".

 

Now this https://delphiworlds.com/download/libreachability-a-for-arm64/ does a nice job. It tells me that the networks has switched, so I can take appropriate action and check for ipv4 or ipv6 connection.

Works great on Android 32 and 64, and probably IOS 32 bit (I cannot test).

However, the library for IOS 64 bit (libReachability64) doesn't work anymore for IOS 64 bit. Compiling fails.

 

Does anyone know if this library is updated so it can be used in Delphi 10.4.1 ?

 

Or another way to be informed when network changes?

 

tia!

John

 

 

Share this post


Link to post
On 3/22/2021 at 5:41 AM, John van de Waeter said:

Does anyone know if this library is updated so it can be used in Delphi 10.4.1 ?

That old code has morphed into this: https://github.com/DelphiWorlds/Kastri/tree/master/Demos/Connectivity which no longer requires the separate static library. It should be able to be used in 10.4.1 (perhaps with changes if necessary) 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×