Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-01

Detecting new connection

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Santiago A.

Hello:

I have a program on Laptop that when network is active (there is a WIFI, ie) must do some tasks (in fact check for updates).

Is there any standard way to do so, without continuously pooling if it can connect to Internet?

Saludos Santi

Reply by email

Michael Van Canneyt
to Santiago A.
Santiago A. wrote 7 lines
Hello: I have a program on Laptop that when network is active (there is a WIFI, ie) must do some tasks (in fact check for updates). Is there any standard way to do so, without continuously pooling if it can connect to Internet?

Not in a cross-platform manner. So you'll need to tell us what OS you are using.

Michael.

Reply by email

Santiago A.
to Michael Van Canneyt

El 31/01/2014 11:55, Michael Van Canneyt escribi?:

Show quoted text 14 lines
On Fri, 31 Jan 2014, Santiago A. wrote: > Hello: > > I have a program on Laptop that when network is active (there is a WIFI, > ie) must do some tasks (in fact check for updates). > > Is there any standard way to do so, without continuously pooling if it > can connect to Internet? Not in a cross-platform manner. So you'll need to tell us what OS you are using.

I supposed so. :-(, I'll have to hook something.

The OS is windows XP/7 and WinCE.
Any idea?

Saludos Santi

Reply by email

Antonio Fortuny
to Santiago A.: Hello: I have a program on Laptop that when network is active (there is a WIFI, ie) must…

Le 31/01/2014 11:40, Santiago A. a ?crit :

Show quoted text 8 lines
Hello: I have a program on Laptop that when network is active (there is a WIFI, ie) must do some tasks (in fact check for updates). Is there any standard way to do so, without continuously pooling if it can connect to Internet?

A standard way to check this I don't know any. I don't even know if an appication can catch events sent by the OS when a network connection raises..
I've made an application wich polls the network for a TCP/IP target : once at the application load and then on a regular basis. to have it as a standard as possible (from my point of view), I'built a service which runs on Win32, Win64, Linux x86_64 and WinCE.
It is almost standard for all platforms as it uses Indy sockets and potocols on both sides: update server and targets. The only exception is the WinCE application wich connects to a local server to check for a new version. But all TCP/IP prorocol is coded in one FPC unit and compiled using Lazarus in all applications that need it.

Antonio.

---
Ce courrier ?lectronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active. http://www.avast.com

Reply by email

Paul Breneman
to Santiago A.: Hello: I have a program on Laptop that when network is active (there is a WIFI, ie) must…
Santiago A. wrote 9 lines
Hello: I have a program on Laptop that when network is active (there is a WIFI, ie) must do some tasks (in fact check for updates). Is there any standard way to do so, without continuously pooling if it can connect to Internet?

Here is a bit I did over ten years ago (please let me know if something is out-of-date):
How can we programmatically detect if the computer our application is running on is connected to the Internet?
http://www.brenemanlabs.com/iConnect.htm

One of the great tragedies of life is the murder of a beautiful theory by a gang of brutal facts.
--Benjamin Franklin

Reply by email