Newbie: testing internet connectvity

Hi

In Java SE, is there any neat way to programmaticaly check to see if the machine is currently connected to the internet?

From my reading so far, it seems all you can do is have a shot in the dark - have go at connecting to the resource, and see if an exception is thrown up.

Thanks,

Graeme

[324 byte] By [graememcca] at [2007-11-27 4:11:20]
# 1

> From my reading so far, it seems all you can do is

> have a shot in the dark - have go at connecting to

> the resource, and see if an exception is thrown up.

Yes, that's what you do. Your requirement is to connect to a particular resource; it might not be working, or there might be no network path between you and the resource for one of many reasons. Connectivity to the Internet is only one of those many reasons, so there's no point in trying to test that.

If you want to connect to a resource, the easiest way is to try connecting and see what happens.

DrClapa at 2007-7-12 9:17:07 > top of Java-index,Java Essentials,New To Java...