Polling is a communication method where client repeatedly sends request to the server to check if any data is available
It has 2 methods :
- Long Polling
- Short Polling
Both methods allow a client to receive updates from a server but they differ significantly in performance and resource usage
Short Polling :
- When a client sends request to the server repeatedly in a fixed interval of time until it gets the desired response its called Short Polling
- It increases the load of the server if the client sends requests in a very short period of time interval
- Therefore Long Polling is prefered over Short Polling
Long Polling :
- When a client sends a request and the server waits for the data to get ready to be sent as response to the client is called Long Polling
- It will decrease the server load completely
- Since it stays connected to a client till the response is ready every request will occupy a port and ports are limited
Top comments (0)