Java Reference
In-Depth Information
Figure 13.4 The interface for the WhoisApplet shows results in a text area for the
whois operation on the domain name entered into the text field at the lower left.
accesses to IP addresses other than the source of the applet. In the figure the
program is running as an application.
13.8 The client/server model
The client/server paradigm has become a dominant one for the Internet. In this
model the clients are programs running on remote machines that communicate
with a program called the server that runs at a single site and responds to requests
from many clients. The server provides the clients with, say, web pages or database
information. Much of the World Wide Web is built on the client/server paradigm.
The clients are web browsers run by many millions of individual users, and the
servers are the many web-hosting systems running at the many host sites on the
web.Asingle server at a single host can support many hundreds or thousands
or more of clients from around the world. Large systems that serve hundreds
of thousands of clients balance the server load over multiple machines in an
arrangement called “server farms.”
With Java you can build client/server systems with sockets or with RMI
(Remote Method Invocation). In the following chapters of Part II we come back
to the client/server model repeatedly, though we will keep things simple by con-
sidering a server to be a program running on a single server computer.
In a socket-based client/server system, a server listens to a particular port for
client applications sending requests for connections. A ServerSocket class is
provided in Java that allows for a server to monitor and answer such requests for
Search WWH ::




Custom Search