z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Client/server socket programs: Iterative server socket programs

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

An iterative server processes requests from clients in a serial manner; one connection is served and responded to before the server accepts a new client connection.

Figure 1 shows the iterative server main logic.
Figure 1. Iterative server main logic
Diagram that shows the main logic between the client and an iterative server.

The following list describes the iterative server socket process.

  1. When a connection request arrives, it accepts the connection and receives the client data.
  2. The iterative server processes the received data and does whatever has to be done to build a reply.
  3. The server sends the data back to the client.
  4. The iterative server closes the socket and waits for the next connection request from the network.

An MVS™ iterative server can be implemented as follows:

  • As a batch job or MVS task started manually, or by automation software. The job remains active until it is closed by operator intervention.
  • As a TSO transaction. For a production implementation, submit a job that executes a batch terminal monitor program (TMP).
  • As a long-running CICS® task. The task normally begins during CICS startup, but it can be started by an authorized CICS operator entering the appropriate CICS transaction code.
  • As a batch message program (BMP) in IMS™.

From a socket programming perspective, there is no difference between an iterative server that runs in a native MVS environment (batch job, started task, or TSO) and one that runs as a CICS task, or as a BMP under IMS.

You can terminate the server process in various ways. For jobs that execute in traditional MVS address spaces (batch job, started task, TSO, IMS BMP), you can implement functions in the server to enable an operator to use the MVS MODIFY command to signal stop; for example F SERVER,STOP. (This technique cannot be used for CICS tasks.) Alternatively, you can include a shutdown message in the application protocol. By doing so, you can develop a shutdown client program that connects to the server and sends a shutdown message. When the server receives a shutdown message from a socket client, it terminates itself.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014