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


Designing a concurrent server program

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

For the MVS™ address space examples presented in this topic, the more traditional MVS subtasking facilities are used; the main process and the child process operate as tasks within the same address space.

You can implement your concurrent server in an IMS™, a CICS®, or a traditional MVS address space environment, but unlike the implementation of an iterative server, the implementation of a concurrent server is unique to its environment. In this topic, the implementation of a concurrent server in an MVS address space is used as an example.

A server handling more than one client simultaneously acts like a dispatcher. The server receives client requests and then creates and dispatches tasks to handle each client.

In the UNIX operating system, a new process is dispatched using the fork() system call after the server has established the connection; this new process automatically inherits the socket attached to the client. In MVS, an independent task is started using the supervisor call instruction ATTACH. A server can complete the call after each connection is established (similar to the UNIX operating system), or it can repeatedly request an ATTACH when it begins execution, and pass clients to tasks that exist. In either case, the server must manually give the new socket to the subtask. Because each task has its own socket table, it is not sufficient to pass only the socket number to the subtask; for example, socket Number 4 for Task A is not the same as socket Number 4 for Task B. You must specify the task as well as the socket number.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014