Home : Course Map :
Chapter 15: Demonstration Client/Servers using Sockets
JavaTech
Course Map

Client/ServerDesign
Processing Steps
Data Server
Run Data Server
    Demo 1
Data Client
DataClient Applet
    Demo 2
Client/Server Sim
SimServer
    Demo 3
SimClient
Run SimClient
    Demo 4
Exercises

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

In this chapter we present two demonstrations of the client/server paradigm. Here the client/server programs use sockets. (Later we will discuss RMI and CORBA techniques.)

The goal is to illustrate how one can use Java quickly to build a client/server system to carry out useful tasks such as transmitting data from a remote experiment, running diagnostics under the direction of a client, installing calibration settings, and controlling an instrument remotely. For demonstration purposes, our servers here generate simulated data.

We begin with an overview of the client/server with sockets:

The first demonstation involves a simple server whose job is to provide a set of data to a client on request. The client initially carries out a log-in procedure with the server and then the server and client follow a simple protocol for requesting, sending, and receiving the data.

Both the server and client provide graphical user interfaces (GUI). The server's GUI displays the status of the communications with the clients in a text area and also includes some controls (button) and input fields. The client's GUI has a set of controls and a text area for communications monitoring plus it includes two histograms to display the data.

The second demonstration combines the client/server code in the first example with the physics experiment demonstration of Chapter 9.

The reader can enhance the two client/server programs in many ways such as suggested in the Exercises

 

Last update: Dec. 10, 2004

 

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.