p. 414: In Figure 13-1, change the second occurrence of "destination port" to "checksum" in the UDP header. The corrected figure is:
pp. 427-429: Example 13-3 and 13-4 share a mutual bug. Both assume they're using the local host's default encoding. However, is these two programs run of different hosts (for instance, one is a Japanese system and one is a French system) that may well not be the same for each. The encoding needs to be explicitly specified in both programs. On p. 427 in Example 13-3 change
byte[] data = theLine.getBytes()
to
byte[] data = theLine.getBytes("UTF-8")
On p. 429 in Example 13-4 change
String s = new String(packet.getData(), 0, packet.getLength())
to
String s = new String(packet.getData(), 0, packet.getLength(), "UTF-8")
This will allow the two hosts to exchange data regardless of differing encodings.
p. 433: In the fifth code line, change new ServerSocket(2048)
to
new DatagramSocket(2048)
. It should read:
DatagramSocket ds = new DatagramSocket(2048)
p. 448: In the second paragraph,
EchoInputThread
should be
SenderThread
.