Schnellzugriff » 
Home 
Java

Java: Periodically check internet connection availability

Freitag, Juni 25th, 2010

A very simple example of how to periodically check the availability of an internet connection by using the observer design pattern.
InternetConnection.java
package net;

import java.net.*;
import java.io.*;

public class InternetConnection {
/* use at least one reliable host, in most cases you will want
to use the one you’re working with later */
private static final String CHECK_URL = “http://www.t-online.de/”;
public static InternetConnectionState isAvailable() [...]

Posted in Java, Programmierung | 1 Comment »>

© 2007 - 2009 Thorsten Boock