In-depth understanding of computer systems Chapter XI second time network programming part1

 

The client - server programming model

Each network applications are based on client - server model. Using this model, an application consists of a server process and one or more client processes components. A resource management server, and to provide some services to its clients through operations such resources.

 

Affairs

The client - server model, the basic operation is a transaction, a client - server transaction consists of the following four steps.

1, when a client needs service, it sends a request to the server to initiate a transaction. For example, when a Web browser needs a file, it sends a request to the Web server.

2, the server receives a request, interpret it, and manipulate it in a suitable manner resources. For example, when the Web server receives a request sent by the browser, it is studying a disk file.

3, the server sends a response to the client, and wait for the next request. For example, Web server, the file will be sent the client.

4, the client receives the response and process it. For example, when a Web browser receives from the server, this page is displayed on the screen.

 

It is important

Recognizing the client and server processes, and the machine or the host is not often mentioned, this is very important. A host can run many different client and server, and a client and a server things can be on the same or different hosts. No matter how the client and server are mapped to the host, the client - server model is the same.

Guess you like

Origin www.cnblogs.com/stone94/p/12068353.html