Miscellaneous changes to java.net worth mentioning:
Noteworthy bug fixes:
A bug existed in JDK1.0.2 where one could not create an InetAddress
out of a IP address String (e.g., "126.96.36.199") if a corresponding
host name (e.g., "java.sun.com") could not be found. This resulted in
an UnknownHostException. The bug is fixed in JDK1.1. Additionally,
when an InetAddress is created from an IP address, the corresponding hostname
is not looked up until specifically requested (via InetAddress.getHostName()),
as a performance enhancement.
- ServerSocket/DatagramSocket close()
A bug existed in JDK1.0.2 where the
close() method of ServerSocket
and DatagramSocket were
synchronized. The result was that if one thread
were blocked indefinitely in DatagramSocket.receive() or ServerSocket.accept(),
another thread couldn't break the blocking thread out by calling close(). This
is fixed in JDK1.1 by making the close() methods unsynchronized.
There was a bug in JDK1.0.2 where the methods on URLConnection:
etc, did not work. These are fixed in JDK1.1.
Binding to local port/address:
- Socket, ServerSocket, DatagramSocket
These classes has overloaded constructors for binding to a specific
local address and port. This is useful and necessary for applications
like proxy servers that operate on multi-homed machines, and need
particular control over which network interfaces are used.
- The MulticastSocket class was moved from package sun.net into the core
API of java.net.
- JDK1.1 introduces a new class, HttpURLConnection which extends
URLConnection, and provides additional functionality specific to
- Ability to use all of the request methods with HTTP/1.1, like:
- Control over whether to follow HTTP redirects.
Last modified: Thu Dec 5 15:09:54 PST