This is the Title of the Book, eMatter Edition
Copyright © 2011 O’Reilly & Associates, Inc. All rights reserved.
Preface
|
xv
Chapters 9 through 11 discuss Java’s low-level socket classes for network access.
Chapter 9, Sockets for Clients, introduces the Java sockets API and the
Socket class in
particular. It shows you how to write network clients that interact with TCP servers
of all kinds including whois, finger, and HTTP. Chapter 10, Sockets for Servers,
shows you how to use the
ServerSocket class to write servers for these and other pro-
tocols in Java. Chapter 11, Secure Sockets, shows you how to protect your client
server communications using the Secure Sockets Layer (SSL) and the Java Secure
Sockets Extension (JSSE).
Chapter 12, Non-Blocking I/O, covers the new I/O APIs introduced in Java 1.4.
These APIs were specifically designed for network servers. They enable a program to
figure out whether a connection is ready before it tries to read from or write to the
socket. This allows a single thread to manage many different connections simulta-
neously, thereby placing much less load on the virtual machine. The new I/O APIs
don’t help much for small servers or clients that don’t open many simultaneous con-
nections, but they provide huge performance boosts for high volume servers that
want to transmit as much data as the network can handle as fast as the network can
deliver it.
Chapter 13, UDP Datagrams and Sockets, introduces the User Datagram Protocol
(UDP) and the associated
DatagramPacket and DatagramSocket classes that provide fast,
unreliable communication. Finally, Chapter 14, Multicast Sockets, shows you how to
use UDP to communicate with multiple hosts at the same time. All the other classes
that access the network from Java rely on the classes described in these five chapters.
Chapters 15 through 17 look more deeply at the infrastructure supporting the
URL
class. These chapters introduce protocol and content handlers, concepts unique to
Java that make it possible to write dynamically extensible software that automati-
cally understands new protocols and media types. Chapter 15, URLConnections,
describes the class that serves as the engine for the
URL class of Chapter 7. It shows
you how to take advantage of this class through its public API. Chapter 16, Protocol
Handlers, also focuses on the
URLConnection class but from a different direction; it
shows you how to subclass this class to create handlers for new protocols and URLs.
Finally, Chapter 17, Content Handlers, explores Java’s somewhat moribund mecha-
nism for supporting new media types.
Chapters 18 and 19 introduce two unique higher-level APIs for network programs,
Remote Method Invocation (RMI) and the JavaMail API. Chapter 18, Remote
Method Invocation, introduces this powerful mechanism for writing distributed Java
applications that run across multiple heterogeneous systems at the same time while
communicating with straightforward method calls just like a nondistributed pro-
gram. Chapter 19, The JavaMail API, acquaints you with this standard extension to
Java, which offers an alternative to low-level sockets for talking to SMTP, POP,
Downloa d f r o m W o w ! e B o o k < w w w.woweb o o k . c o m >