Java, Java, Java
18. Sockets and Networking
OBJECTIVES
After studying this chapter, you will
Understand some basics about networks.
Know how to use Java’s URL class to download network resources from a GUI or console application.
Be able to design networking applications, using the client/server model.
Understand how to use Java’s Socket and ServerSocket classes.
OUTLINE
Introduction
An Overview of Networks
Using Network Resources from an Applet
From the Java Library: java.net.URL
The Slide Show Program
Using Network Resources from an Application
Client/Server Communication via Sockets
Case Study: Generic Client/Server Classes
Playing One Row Nim Over the Network
Java Network Security Restrictions Special Topic: Privacy and the Internet
Java Servlets and Server Pages
Chapter Summary
Solutions to Self-Study Exercises Exercises
693
Network topology
Figure 15.1: Star, bus, and ring topologies.