The difference websockt and http

Summary: Project: Client ios android client
server php
Requirements: server sends data to the client
the client requests the server side data
technologies: WebSocket transmit data without using http to transfer data
reasons: http connection: http connection is called short connection, i.e. after the client sends a request to the server, the server will respond to a connection that is cut off;
Socket connection: socket connection is called a long connection, the client and server side theory upon connection will not be active cut off; however, due to various environmental factors may be disconnected, such as: the server or the client host down, network failure, or the long time between the two data transmission, the network firewall may disconnect the connection to free up network resources. So when a socket connection is not transmitting data, then in order to maintain the connection needs to send a heartbeat message ~~ DETAILED heartbeat message format is defined by the developer's own.

Published 58 original articles · won praise 0 · Views 2762

Guess you like

Origin blog.csdn.net/qq_30439399/article/details/103685647