473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Internet connection availability notification

Hello,
Is there a way to receive a notification when an internet connection
becomes available and when it becomes unavailable?
Thanks.

Nov 16 '05 #1
5 2064
Hi,

No really, there is not such a concept of as connected to the internet,
you can use one of several workaround ( or all of them )

1- Check if the device has at least one IP different that the localhost
2- See if you can connect to some predefined server/address ( this may fail
due to proxies config. )
3- Try to resolve some name to its IP, in general the DNS is always
accesible even if a proxy exist.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"yk63fd01" <yk******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello,
Is there a way to receive a notification when an internet connection
becomes available and when it becomes unavailable?
Thanks.

Nov 16 '05 #2
Hi,

Thanks for the reply. Right now, I have a thread which is attempting
to do ftp transfers, so it does fail in the DNS resolution phase (as
you mentioned above) and sleeps a certain time before trying again.
But, I was hoping to be able to use an interrupt method instead of
polling (as it would be more efficient).

Thanks

Nov 16 '05 #3
One other thing. This doesn't have to be done with pure .NET. Isn't
there a way to do this using the Win32 API? I know some things like
receiving notification of a CD inserted can be done with APIs, but I
can't seem to locate anything for network connectivity.

Nov 16 '05 #4
Hi,

AFAIK there is nothing like that, as I said before being "connected to the
internet" is relative , maybe there is somethign when a network adapter
change its configuration, don;t know for sure but even so is the same thing,
it may be connected locally and your remote server is not available

pooling is the only solution I see here.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"yk63fd01" <yk******@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
One other thing. This doesn't have to be done with pure .NET. Isn't
there a way to do this using the Win32 API? I know some things like
receiving notification of a CD inserted can be done with APIs, but I
can't seem to locate anything for network connectivity.

Nov 16 '05 #5
yyy
Set a timer and use this:
http://www.csharphelp.com/archives3/archive499.html

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martin Russ | last post by:
Hi, I have an application in development intended for wireless users that needs to know when a Network or Internet connection becomes available. Does anyone know how this is done, or can...
9
by: Tom Dacon | last post by:
I have a little desktop application (it happens to be a Windows Forms analog clock) that's written in VB.Net (2003). I placed a shortcut in my Startup program group to start it up when I log on. I...
1
by: Martin Russ | last post by:
Hi, I'm faily new to vb.net, but I have an application intended for wireless users that needs to know when a network/internet connection becomes available. Does anybody know how to do this or...
8
by: Nikola Bucic | last post by:
Could someone tell me how can I constantly check if I'm connected to internet and if possible to determine what type of connection is it. My best shot wright now is to have a timer which will...
0
by: ip2location.inc | last post by:
IP2Location has announced the availability of IP2Location .NET Component, that enables application developers to geolocation the Internet visitors by IP Address from their .NET applications. ...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
5
by: Tom Rahav | last post by:
Hello, How can I create an application/win-service in .NET that runs in the background and detects automatically when the computer connects to the internet? I want to have a program that runs...
6
by: =?Utf-8?B?QnNtZW5nZW4=?= | last post by:
I am trying to make sure that the local connection is up. I have presently been using the NetworkChange.NetworkAvailabilityChanged Event for this. Is there a better way to do this? Also, I...
0
myusernotyours
by: myusernotyours | last post by:
I have this elusive problem that I can't seem to get my fingers on. This is the senario: I am working at a client's site (am a developer) and they have assigned me this nice little HP-Compaq...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.