HPlogo HP 9000 Networking: BSD Sockets Interface Programmer's Guide > Chapter 1 BSD Sockets Concepts

The Client-Server Model

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

Typical BSD Sockets applications consist of two separate application level processes; one process (the client) requests a connection and the other process (the server ) accepts it.

The server process creates a socket, binds an address to it, and sets up a mechanism (called a listen queue) for receiving connection requests. The client process creates a socket and requests a connection to the server process. Once the server process accepts a client process's request and establishes a connection, full-duplex (two-way) communication can occur between the two sockets.

This set of conventions must be implemented by both processes. Depending upon the needs of your application, your implementation of the model can be symmetric or asymmetric. In a symmetrical application of the model, either process can be a server or a client. In an asymmetrical application of the model, there is a clearly defined server process and client process. An example of an asymmetrical application is the ftp service.

Creating a Connection: the Client-Server Model

The following figures illustrate conceptual views of the client-server model at three different stages of establishing a connection. The completed steps are included in each figure.

Figure 1-1 Client-Server in a Pre-Connection State

[Client-Server in a Pre-Connection State]

Figure 1-2 Client-Server at Time of Connection Request

[Client-Server at Time of Connection Request]

Figure 1-3 Client-Server When Connection is Established

[Client-Server When Connection is Established]