Java Network Programming, Second Edition By Elliotte Rusty Harold Following are the changes made in the 3/01 reprint. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification [133] In the first paragraph: "Notice the addition of a start() method" now reads: "Notice the addition of the calculateDigest() method to start the thread." {177} The second sentence of the third paragraph now reads, "The conditional operator ? tests whether signedByte is negative." That is, unsignedByte has been changed to signedByte. (195) In the third paragraph, "foloowing" now reads "following". {220} In Example 7-8, the line: System.out.println(URLEncoder.encode("This\string\"has\"quote\"marks")); was missing a quote mark after the first slash. It now reads: System.out.println(URLEncoder.encode("This\"string\"has\"quote\"marks")); [323-324] In Example 10-7, the finally block was attached to the wrong try block. It is now inside the for loop. Here's the corrected program: import java.net.*; import java.io.*; public class PortScanner { public static void main(String[] args) { String host = "localhost"; if (args.length > 0) { host = args[0]; } try { InetAddress theAddress = InetAddress.getByName(host); for (int i = 1; i < 65536; i++) { Socket connection = null; try { connection = new Socket(host, i); System.out.println("There is a server on port " + i + " of " + host); } catch (IOException e) { // must not be a server on this port } finally { try { if (connection != null) connection.close(); } catch (IOException e) {} } } // end for } // end try catch (UnknownHostException e) { System.err.println(e); } } // end main } // end PortScanner [327] InterruptedException has been changed to: InterruptedIOException {354} In the code fragment in the middle of the page, InetAddress.getHostByName now reads InetAddress.getByName {385} About three quarters of the way down the page, at the end of the second code block: } // end try now reads: } // end if