It is very easy to confuse these requests. The author arranges them according to his own understanding. The picture is slightly ugly.

polling

define

The Client periodically sends requests to the Server to maintain data synchronization with the Server. Multiple Http short connections are established.

The illustration



Long polling

define

At the HTTP layer, a connection is maintained. If there is no data update after the Server receives the request from the Client, the connection is held for a period of time until there is data or the connection times out.

The illustration



Short connection

define

A normal Http request. The Server responds to requests promptly.

A long connection

define

HTTP1.1 consolidates multiple HTTP requests into one by using Connection:keep-alive. Multiple HTTP requests can be completed in a single TCP connection, but you still send separate headers for each request. It is actually a long connection at the Tcp layer.

The illustration