Long Polling:-
Long polling is what that provides emulation of an information push from server to client, however if the server does not have any information available for the client, instead of sending an empty response, the server holds the request and waits for some information available, once the information becomes available (or after a suitable time out), a complete response is sent to the client. The client will normally, then immediately re-request the information from the server re-request the information from the server so that the server will almost always have an available waiting request that it can use to deliver data in response to an event. It is a little bit it is a little bit variation traditional polling technique.
Web sockets and Server sent Events:-
- Web Sockets and SSE (Server Sent Events) are both capable of pushing data to browsers; however they are not competing technologies.
- Web sockets connections can both send data to the browser and receive data from the browser. A good example of an application that could use web sockets is a chat application.
- SSE connections can only push data to the browser. Online stock quotes, or twitters updating timeline or feed are good examples of an application that could benefit from SSE.
- In practice since everything that can be done with SSE can also be done with Web sockets, Web sockets is getting a lot more attention and love, and many more browsers support Web sockets than SSE.
Blogger Comment
Facebook Comment