Corrections to Chapter 11 of Java Network Programming, Sockets for Servers

p. 354: In the code fragment at the bottom of the page, InetAddress.getHostByName("metalab.unc.edu") should be InetAddress.getByName("metalab.unc.edu"). That is,
        try {
          ServerSocket httpd = new ServerSocket(5776, 100,
           InetAddress.getByName("metalab.unc.edu"));
        }
        catch (IOException e) {
          System.err.println(e);
        }
p. 385: About three quarters of the way down the page, at the end of the second code block,

} // end try

should be

} // end if

That is, change try to if in the comment.

[ Java Network Programming Corrections | Java Network Programming Home Page | Table of Contents | Examples | Order from Amazon ] ]

Copyright 2001 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 31, 2001