Click to See Complete Forum and Search --> : How can I determin if a machine is connected to the internet ?


sanjay vyas
April 13th, 1999, 06:06 AM
Hi,

I need to dtect in my program if a machine is connected to the net. However, the machine can be dialing independently using RAS or even be behind a LAN/proxy.

I have tried using InternetGetConnectedState() however, it does not detect my machine as disconnected even when I physically disconnect my CAT 5 cable from the LAN (I am behind a LAN/Proxy)

I cannot depend on InetIsOffline() because shell32.dll version 4 is not a prerequisite for my program.

Can anybody help ?

Any input would be appreciated.

Thanx,

sanjay

Masaaki
April 13th, 1999, 12:52 PM
Hi.

Try CSocket or CAsyncSocket - Connect().

Hope for help.
-Masaaki Onishi-

sanjay vyas
April 14th, 1999, 01:47 AM
Hello Masaaki ,

Thanx for the info, I will be unable to do this directly because I am not writing an MFC based app.
My app wants to be independent of MFC42.dll etc..

However, I will check out the implementation of these methods by MFC and see if it is helpful.

Any other method will be really helpful

-sanjay

Andy St.Clair
April 14th, 1999, 02:24 AM
Rasenumconnections() functions tells you what Dial Up network connections are active.

if you want to see if the network is actually ok you could try
sending something to the echo port on a remote
server such as www.microsoft.com or some other
server you know and see if it echo's it back.