Study Notes (64): Chapter 1: Machine Learning - Classification Training 02

Learning immediately: https://edu.csdn.net/course/play/26302/333412?utm_source=blogtoedu

1. Socket connection with HTTP:


As is usually the case Socket connection is a TCP connection, therefore Socket Once connected, communicating parties can start sending data content to each other, until both disconnected. But in the real network applications, the communication between the client to the server often need to traverse multiple intermediate nodes, such as routers, gateways, firewalls and so on, most of the default firewall closes the connection is inactive for a long time which led to Socket connection is broken even, you need to tell the network by polling, the connection is active.

The HTTP connection using the "request - response" approach, not only in the need to establish a connection request, and the need for client makes a request to the server, the server can respond to data.

In many cases, the server needs to take the initiative to push data to the client, in real time and synchronize client and server data. At this point if the two sides to establish a Socket connection, the server can transmit data directly to the client; if the two sides to establish a HTTP connection, the server need to wait until after the client sends a request to the data back to the client, therefore, the client sends to the server connection timed please
seek not only remain online, but also in the "ask" whether the server has new data, if the data will be passed to the client.

collusion http protocol is an application layer

have a relatively description of the image: HTTP passenger car, a particular form of packaging or display data; the Socket engine, provides the ability to network communications.

Communication between the two computers is simply a data communication between the two ports will show a specific data 'is different application layer protocols, such as defined in what form HTTP`FTP` ...

 

The real socket is high, some games and app micro-channels are connected using socket

 

2. http, the difference between the TCP / IP protocol and socket:
 

Network divided up by the following:
 

Physical layer -                      
 

data link layer--
 

The network layer - IP protocol
 

The transport layer - TCP protocol
 

Session layer -
 

Presentation layer and application layer - HTTP protocol

 

 

Published 73 original articles · won praise 3 · Views 742

Guess you like

Origin blog.csdn.net/wj1408421029/article/details/104439421