How to manage the length of the connection proxy server

A common process http connection

Browser parses out the hostname of 
the browser queries the IP address (DNS) host name of the 
browser to get the server port 
the browser to initiate a request to the server 
to send the browser to the server a HTTP GET message 
browser reads the HTTP response message from the server Wen 
browser closes the connection

Second, the HTTP request from the TCP processing program See

1. server: Create a socket (socket); to bind a socket to port (bind); allow socket connection (listen); waiting for the connection (the Accept) 
2. Client: Get the server ip address and port number; creates a socket (socket); connect to the server ip: the port (connect) 
3. server: notification application has connections come in; start reading request (the read) 
4. client: connection success; sends an HTTP request (Write); wait HTTP response (Read) 
5. The server: processing an HTTP request message; HTTP response sent back (Write); close the connection (Close) 
6. The client: HTTP response processing; close the connection (Close)

 

Guess you like

Origin www.cnblogs.com/charon2/p/11738441.html