try {
boolean lookingForLineFeed = false;
outer: while (true) {
// read the next line
StringBuffer sb = new StringBuffer(80);
while (true) {
int c = in.read();
if (c == '\n") {
if (lookingForLineFeed) {
lookingForLineFeed = false;
continue;
}
else break;
}
else if (c == '\r") {
lookingForLineFeed = true;
break;
}
else if (c == -1) {
break outer;
}
else {
sb.append((char) c);
}
}
// separate out the IP address
String entry = sb.toString();
// find the host name and print it out
Thread t = new ReverseLookup(entry, this);
t.start();
Thread.yield();
} // end while
}
catch (IOException e) {
System.out.println("Exception: " + e);
}