Article View: borland.public.cppbuilder.internet.socket
Article #1712Re: How to check, if my LAN-connection is currently available or not?
From: MR
Date: Tue, 28 Nov 2006 12:16
Date: Tue, 28 Nov 2006 12:16
61 lines
2768 bytes
2768 bytes
"Tom" <tom@nospam.net> schrieb:
>Try this:
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/inetisoffline.asp
>
>I use it in my programs and it seems to work well, as far back as Win95 and
>NT
Thanks for you answer.
I tried
if(InetIsOffline(0/*dwFlags*/)) {
Beep();
Sleep(50);
Beep();
}
but unfortunately I never un into this Beep()-block.
I'm not so sure, what MS means with
Returns FALSE if ... if no attempt has yet been made to connect to
the Internet.
I use TIdHTTP::Get() to download a file. If I plug out the
ethernet-cable while downloading and thus make Get() fail and
afterwards call InetIsOffline() this function also returns FALSE.
~~~~
I just found further explanation in the header-file:
// Off-line mode begins when the user has been prompted to dial-in
to
// an Internet providor, but canceled the attempt.
So perhaps this module it just sets a global var to the offline-value
to TRUE if it's own try to dial-in failed. If no try is made from
winthin this module, it stays FALSE (=online).
So if the dial-in is made by another module/class it is not
recognized...
~~~~~~~~~~~~~~~~
Btw. having DSL I never explicitely dial in. I suppose there is just a
test, if my DSL-MOdem is available (by trying to access it by a
certain TCP/IP-Address) and if not the connection failed.
??? What about trying to ping it? Could this be the solution to my
problem?
Could it really be so hard to find this out, when even windows
displays the state it in the task-bar explicitely?
Thanks,
Michael
Technical Details
Message-ID:
<q38om2d5or8d1voqmcbde6kngs6a7i4r1k@4ax.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4bpam21rfr9noj29g2ol5jp008gekpvuf8@4ax.com> <45657d06$1@newsgroups.borland.com> <c0hbm21kmuro6k0aa029usf5o2hhhgo21c@4ax.com> <4565d3ec$1@newsgroups.borland.com> <k6mnm2dcmufovp2ibp76cnhdq1htpfci6h@4ax.com> <456bf3f0$1@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: Tue, 28 Nov 2006 13:16:15 +0100 Message-ID: <q38om2d5or8d1voqmcbde6kngs6a7i4r1k@4ax.com> References: <4bpam21rfr9noj29g2ol5jp008gekpvuf8@4ax.com> <45657d06$1@newsgroups.borland.com> <c0hbm21kmuro6k0aa029usf5o2hhhgo21c@4ax.com> <4565d3ec$1@newsgroups.borland.com> <k6mnm2dcmufovp2ibp76cnhdq1htpfci6h@4ax.com> <456bf3f0$1@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.20.92 X-Trace: newsgroups.borland.com 1164716042 88.64.20.92 (28 Nov 2006 04:14:02 -0700) Lines: 61 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail