🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3022

Re: Verify if it is connected to the Internet ???

#3022
From: John P. McGrath
Date: Mon, 25 May 1998 00:00
15 lines
921 bytes
Gustavo <dutra@trip.com.br> wrote in article
<6k9lvt$4lo8@forums.borland.com>...
 
> How can I verify if I am connected to the Internet , I want to use the
> sockets and URL components , but they raise exceptions if it is not
> connected .

Put the code to open the connection in a try block.  If it throws a
connection (probably an UnknownHostException), then you are not connected.

-- 
John P. McGrath
<mcgrath@enter.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID: <01bd87b7$ff189d10$0e47aacc@ferd>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6k9lvt$4lo8@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,5169890244437985
X-Google-Attributes: gid1089d0,public
From: "John P. McGrath" <mcgrath@enter.net>
Subject: Re: Verify if it is connected to the Internet ???
Date: 1998/05/25
Message-ID: <01bd87b7$ff189d10$0e47aacc@ferd>
X-Deja-AN: 356269009
References: <6k9lvt$4lo8@forums.borland.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.api