Article View: borland.public.cppbuilder.internet.socket
Article #1720Re: How to check, if my LAN-connection is currently available or not?
From: MR
Date: Sun, 03 Dec 2006 05:25
Date: Sun, 03 Dec 2006 05:25
34 lines
1900 bytes
1900 bytes
Thanks for your helpful answer.
>Look at :
>::IsNetworkAlive
>::InternetGetConnectedState and ::InternetCheckConnection
The first two functions seem to return the state I has asked for:
for the fist a DLL seems necessary,
for the second a library included:
#pragma comment(lib, "wininet.lib")
In my case with them I can find out, if there is a connection between
my laptop and the dsl-network-router.
More for fun as for need I cut the connection between the Internet and
the dsl-network-router, i.e. I could access to the LAN, but not to the
internet any more.
The result was, that both functions return a value, which means the
inernet-connection is correct.
Is there a better way to find out if the connection to the internet is
available than trying to download a small page/file from a site, known
as available.
[As said, I'm quite happy with the functions above, but tending to
make things as perfect as possible this would be even better.]
Thanks,
Michael
Technical Details
Message-ID:
<fum4n217n2560iv9r4nbptc0qpv3kdnb6d@4ax.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4bpam21rfr9noj29g2ol5jp008gekpvuf8@4ax.com> <456c3d4d@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,905341194f734f35 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: <MR> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: How to check, if my LAN-connection is currently available or not? Date: Sun, 03 Dec 2006 06:25:35 +0100 Message-ID: <fum4n217n2560iv9r4nbptc0qpv3kdnb6d@4ax.com> References: <4bpam21rfr9noj29g2ol5jp008gekpvuf8@4ax.com> <456c3d4d@newsgroups.borland.com> X-Newsreader: Forte Free Agent 3.3/32.846 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 88.64.16.138 X-Trace: newsgroups.borland.com 1165123379 88.64.16.138 (2 Dec 2006 21:22:59 -0700) Lines: 34 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail