Java 2 Networking
Updates

This page contains links to the latest updates of the code and text to the Java 2 Networking book. Periodically new bits will be added so check back once a month or two. The updates here are currently compiled and tested against JDK 1.2.2rc1.

  Return to top

General

As usual of a .0 release, a number of bad bugs still existed. As of JDK 1.2.2, a number of fixes should be forthcoming. AFAIK, the following bugs have been fixed:

FileNameMap

With JDK 1.2 FCS, if you requested the currently set FileNameMap from URLConnection, it would create an inner class wrapper around the current instance and return that. The problem is, if you create that nested structure like I showed in the book, it would create an endless loop on the lookup process with the obvious resulting code lock ups.

URL Parsing

There were a couple of bugs related to the internal parsing and construction of URLs. What happens now is that parsing is now more correct, but not complete. One major problem is that if your URL contained authority information (that is a name and password, eg http://name@passwd:www.vlc.com.au/) it would be treated as part of the host name. Apparently this still exists but may be fixed in 1.2.3 or later.

Authentication

This is one that I missed on my last minute checks. Authentication broke between RC2 and FCS releases. Even if you set an authentication class, it was not called even when the underlying protocol asked for it. Should be fixed for 1.2.2.

UDP Fixes

One major gripe of a number of programmers was that the UDP code was very lossy in high data rate environments. Even though UDP is specified to be unreliable, these programmers still complained. In particular, Sun's implementation appeared to be particularly bad. With 1.2.2, a number of performance increases have been made to increase the number of packets making it to user level code.

The first improvement is that InetAddresses are now cached per connection. The current code used to create a new InetAddress instance for every packet recieved. This is no longer the case.

A future improvement, not currently in 1.2.2, but coming (hopefully) in 1.2.x is the removal of excess data copying. Under the current code, the same array of bytes is copied twice before making it to user level code. The current aim is reduce that to one or zero copies.

  Return to top

Chapters 8 - 9: RMI

One important piece of information that came out of the 1999 JavaOne conference is the news that apparently Sun never intended rmiregistry to be a production system! I find this absolutely amazing that it has taken them 3 years to mention this. They actually suggested that you should be using some commercial lookup system to locate and load your objects. In particular, they suggested using the JINI directory services for your normal RMI objects. This was not just a once off comment by some engineer, but repeated on a number of occasions by people like Bill Day (normally at JINI associated events).

A really important piece of information that I forgot to put in the book was how rmic and the stub/skeleton system has changed with Java 2. By default, rmic generates Java 1.1 compatible output. Java 2 has removed the need for the skeleton classes to be generated. So, using the command

  rmic -v1.2 classnames
it will produce Java 2 compliant code only. Be warned, if you do this, the RMI classes will no longer be able to talk to Java 1.1 server objects. If you need to do this, then you might want to use the -vcompat option instead. Classes generated by this will be able to deal with both 1.1 and 1.2 versions of Java.

Performance: With Java 2, the implementation now makes use of a single socket connection for all objects located on a particular server. While this did not happen by default with Java 1.1 (you could provide your own socket factory to overcome this) this behaviour may be interesting to watch for performance. Generally speaking, it should work much faster but there are situations where the extra traffic over a single connection could cause bottlenecks. Where the old approach will generally be better is if you are using multiple CPU machines where individual socket connections can be serviced in parallel - assuming a native threads implementation of the JVM.

  Return to top

Chapters 11 - 13: JSDT

In late May 1999, Sun released the latest version of the Java Shared Data Toolkit -v 1.5. A lot of interest has been generated following the JavaOne conference the following month. Of course, dropping the license fee greatly helped too. Here we'll look at updates to the book specifically. If you have more general questions, please look at the FAQ first.

Compared to v1.4, there are not that many API changes. The main changes are to make the API more consistent, which you'll see later, and addition of new transport mechanisms. Overall, the basic functionality and code hasn't changed from what you've read.

Now, onto the more important items - the updates themselves. Each chapter is treated individually, so please check the appropriate area.

  Return to top

[ Homepage ][ J2 Networking ][ Linux ][ Books ][ Java ][ About ]