type
status
date
slug
summary
tags
category
icon
password
URL
实现服务器端推送消息的目的,主要有三种实现方式
🤔 1.HTTP定时轮询
In small time fragments (usually 1-2sec), continuously send http request to server to get the information that we are waiting for.
🤔 2.长轮询机制,comet技术
set the http overtime to a longer time, when we send a request, we tolerate a very long (usually 20-30 sec) response delay.
🤔 3.Websocket
The advantage of WebSocket is its ability to establish and maintain a persistent, full-duplex communication channel between the client and the server. This allows for real-time, bi-directional data transfer without the need for continuous polling or long response delays. WebSocket is efficient, low-latency, and well-suited for applications that require instant updates or real-time interaction.
- 作者:NotionNext
- 链接:https://blog.battleboy.top/article/5c6c340f-f60a-4778-8ccc-45f087a6ee34
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。