Excerpt
Welcome to
Java Network Programming and Distributed Computing . The goal of this book is to introduce and explain the basic concepts of networking and discuss the practical aspects of Java network programming.
This book will help readers get up to speed with network programming and employ the techniques learned in software development. If youve had some networking experience in another language and want to apply your existing skills to Java, youll find the book to be an accelerated guide and a comprehensive reference to the networking API. This book does not require you to be a networking guru, however, as Chapters 1-4 provide a gentle introduction to networking theory, Java, and the most basic elements of the Java networking API. In later chapters, the Java API is covered in greater detail, with a discussion supplementing the documentation that Sun Microsystems provides as a reference.
What Youll Learn
In this book, readers will learn how to write applications in Java that make use of network programming. The Java API provides many ways to communicate over the Internet, from sending packets and streams of data to employing higher-level application protocols such as HTTP and distributed computing mechanisms.Along the way, youll read about:
How the Internet works, its architecture and the TCP/IP protocol stack The Java programming language, including a refresher course on topics such as exception handling Javas input/output system and how it works How to write clients and servers using the User Datagram Protocol (UDP) and the Transport Control Protocol (TCP) The advantages of multi-threaded applications, which allow network applications to perform multiple tasks concurrently How to implement network protocols, including examples of client/server implementations The HyperText Transfer Protocol (HTTP) and how to access the World Wide Web using Java How to write server-side Java applications for the WWW Distributed computing technologies including remote method invocation (RMI) and CORBA How to access e-mail using the extensive JavaMail API What Youll Need
A reasonable familiarity with Java programming is required to get the most out of this book. Youll need to be able to compile and run Java applications and to understand basic concepts such as classes, objects, and the Java API. However, you dont need to be an expert with respect to the more advanced topics covered herein, such as I/O streams and multi-threading. All examples use a text interface, so theres no need to have GUI experience.
Youll also need to install the Java SDK, available for free from Sun Micro-systems (http://java.sun.com/j2se/). Java programmers will no doubt already have access to the SDK, but readers should be aware that some examples in this text will require JDK 1.1, and the advanced sections on servlets, RMI and CORBA, and JavaMail will require Java 2.
A minimal amount of additional software is required, and most of the tools for Java programming are available for free and downloadable via the WWW. Chapter 2 includes an overview of Java development tools, but readers can also use their existing code editor. Readers will be advised when examples feature additional Sun Microsystems software.
Companion Web Site
As a companion to the material covered in this book, the books Web site offers the source code in downloadable form (no need to wear out your fingers!), as well as a list of Frequently Asked Questions about Java Networking, links to networking resources, and additional information about the book. The site can be found at http://www.davidreilly.com/jnpbook/.
Contacting the Authors
We welcome feedback from readers, be it comments on specific chapters or sections or an evaluation of the book as a whole. In particular, reader input about whether topics were clearly conveyed and sufficiently comprehensive would be appreciated. While wed love to receive only praise, honest opinions are valued (as well as suggestions about coverage of new networking topics).
Feel free to contact us directly. While we cant guarantee an individual reply, well do our best to respond to your query. Please send questions and feedback via e-mail to: [email protected].
David Reilly and Michael Reilly
September 2001
0201710374P03282002