icegem-cache-utils/src/main/java/com/googlecode/icegem/cacheutils/common/Utils.java
public static boolean isSocketAlive(String host, int port) {
	boolean socketAlive = false;
	Socket socket = null;
	
	try {
	    socket = new Socket(host, port);
	    
	    socketAlive = socket.isConnected();
	} catch (Throwable t) {
	    // do nothing
	} finally {
	    if (socket != null) {
		try {
		    socket.close();
		} catch (IOException e) {
		    // do nothing
		}
	    }
	}
	
	return socketAlive;
    }
public static boolean isSocketAlive(String host, int port) {
	boolean socketAlive = false;
	Socket socket = null;
	
	try {
	    socket = new Socket(host, port);
	    
	    socketAlive = socket.isConnected();
	} catch (Throwable t) {
	    // do nothing
	} finally {
	    if (socket != null) {
		try {
		    socket.close();
		} catch (IOException e) {
		    // do nothing
		}
	    }
	}
	
	return socketAlive;
    }
Checks if the socket of specified host and port is alive.

@param host
- the host.
@param port
- the port.
@return - true if alive, false otherwise.