Daily Archives: April 28, 2021

short polling, long polling, websocket

short polling
ajax based call. Every fixed amount of time, it calls server and get the result(the result might be empty as well).

long polling
When client and server hasĀ opened a TCP connection, it won’t close. Client just wait. Whenever there is message in server side, it sends to client.

web socket
client builds a web socket with server. When it opens, server can control the websocket, and send whatever server wants to client.