Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
detect lost internet connection via a hook
#1
Hi,
I am in the process of creating a push notification service where the clients will be connected all the time to the http server providing the service. I am creating the server and client apps, but I need to detect when the connection is lost on the client side via something similar to a windows hook. I don't want to create a TTimer or a thread to keep checking the connection. I want something more smarter that mimic the same thing on cell phones (Android/iOS).

I want the client to know when the connection was lost and when it was restored so it can reconnect to the service again automatically. 

Knowing that the PCs that will run this will be inside a domain so some users will be allowed access to the internet, some won't. So I can't do something like keep pinging "google.com" or any other website because it will not work for some users. 

This has to be done using Indy components only because I want the app to support other OS(s) as well when the C++ Builder supports Linux for example. So it has to be as cross platform as possible.

For example, I want the program to detect if I removed the Ethernet cable or turned off the WiFi on the laptop, and when I reconnect the Ethernet cable or turn WiFi on it should detect that too.

I remember there was a talk about this or something similar somewhere but I can't find it again. Anyway

Thanks in advance,
Ahmed Sayed
Reply


Messages In This Thread
detect lost internet connection via a hook - by Ahmed Sayed - 04-06-2022, 08:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)