Threaded TCP Clients and Server


Other Kinds of Java Networking

The networking support in Java is one of its greatest strengths. This section is a brief tour of some of the capabilities that I haven't previously mentioned.

J2SE 1.4 added support for secure sockets (using the SSL and TLS protocols) in the Java Secure Socket Extension (JSSE) libraries. Security is a complex topic, but it's still fairly easy to do a common thing such as retrieve a web page using the HTTPS protocol. The Core Java Technologies Tech Tip for August 2004 includes a good introduction to JSSE (http://java.sun.com/developer/JDCTechTips/2004/tt0817.html).

Remote Method Invocation (RMI) allows Java objects on separate machines to communicate via remote method calls. This is considerably higher-level than data transmission through sockets. RMI is based on a procedural programming technique, the Remote Procedure Call (RPC), but with some powerful extensions. One is dynamic code loading, which allows a client to download the communication code (called a stub) for accessing a remote method at run time. Code loading from clients can be carried out by a server.

RMI is the basis of a number of expressive networking models, including Jini mentioned below. RMI is integrated with the communications protocol for the Common Object Request Broker Architecture (CORBA), which permits Java objects to interact with objects coded in other languages.

Jini is a service discovery architecture that allows Jini-enabled clients to find and utilize whatever services are available on a network, dynamically adjusting their connections as new services come on-stream and others leave. This is of key importance for mobile devices. The starting point for Jini is http://www.jini.org/.

A good book on Java networking is Java Network Programming by Elliotte Rusty Harold (O'Reilly).



Killer Game Programming in Java
Killer Game Programming in Java
ISBN: 0596007302
EAN: 2147483647
Year: 2006
Pages: 340

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net