if (server == null) {
throw new BuildException("No server specified in socket "
+ "condition");
}
if (port == 0) {
throw new BuildException("No port specified in socket condition");
}
log("Checking for listener at " + server + ":" + port,
Project.MSG_VERBOSE);
java.net.Socket s = null;
try {
s = new java.net.Socket(server, port);
} catch (IOException e) {
return false;
} finally {
if (s != null) {
try {
s.close();
} catch (IOException ioe) {
// Intentionally left blank
}
}
}
return true;