be harmful for的意思:请朋友帮忙翻译一下,谢谢拉

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 02:31:46
HTTP can use both nonpersistent connections and persistent connections. HTTP/1.0 uses nonpersistent connections. Conversely, use of persistent connections is the default mode for HTTP/1.1.
Nonpersistent Connections
Let us walk through the steps of transferring a Web page from server to client for the case of nonpersistent connections. Suppose the page consists of a base HTML file and 10 JPEG images, and that all 11 of these objects reside on the same server. Suppose the URL for the base HTML file is
www.someSchool.edu /someDepartment/home.index.
Here is what happens:
1. The HTTP client initiates a TCP connection to the server www.someSchool.edu. Port number 80 is used as the default port number at which the HTTP server will be listening for HTTP clients that want to retrieve documents using HTTP.
2. The HTTP client sends a HTTP request message to the server via the socket associated with the TCP connection that was established in step 1. The request message includes the path name/someDepartment/home.index.(We will discuss the HTTP message in some detail below.)
3. The HTTP server receives the request message via the socket associated with the connection that was established in step 1,retrieves the object/someDepartment/home.index from its storage(RAM or disk),encapsulates the object in an HTTP response message ,and sends the response message to the client via the socket.
4. The HTTP client receives the response message. The TCP connection (But TCP doesn’t actually terminate the connection until the client has received the response message intact.)
5. The HTTP client receives the response message .The TCP connection terminate. The message indicates that the encapsulated object is an HTML file .The client extracts the file from the response message, parses the HTML file, and finds references to the 10 JPEG objects.
6. The first four steps are then repeated for each of the referenced JPEG objects

HTTP能采用非持续性连接和持续性连接。HTTP/1.0采用的是非持续性

连接。相反的,HTTP/1.1则采用持续性连接。

非持续性连接

作为非持续性连接的一个例子,让我们来看看一张网页从服务端传输

到客户端的步骤吧。假设这张网页由一个基本的HTML文件和10张HPEG

图片组成,因此就一共有11个对象驻存于服务端。假设这个基本的HT

ML文件的URL地址为www.someSchool.edu /someDepartment/home.index.
接下来看看发生了什么:
1、HTTP客户端发起一个向服务端www.someSchool.edu的TCP连接。端口号80是HTTP服务器监听的默认端口号,通过这个端口号,服务器可以知道HTTP客户端通过HTTP索要的文件。
2、HTTP客户端通过由步骤1所建立的TCP连接所相关的socket端口向服务端发送一个HTTP请求报文。这个请求报文中包括了路径name/someDepartment/home.index(稍后,我们将会详细讨论HTTP报文)
3、HTTP服务端接收到通过由步骤1所建立的TCP连接所相关的socket端口传来的请求报文,从它的存储空间(内存或者是影盘)中取出/someDepartment/home.index的对象,将他们打包成一个响应报文,并将其通过端口发送给客户端。
4、HTTP客户端接收响应报文。TCP连接(直到客户端收到完整的响应报文TCP才会终止连接)
5、HTTP客户端收到响应报文,TCP连接中断。报文显示打包的对象是一个HTML文件。客户端从响应报文中解出这个文件,解析HTML文件,然后发现,这个文件与10张JPEG图相关。
6、为了取得那10张JPEG图,每张图的取得需重复上面的1-4步