3 ms·
Have a look into websockets. They are used to create an always open connection between the client and server. Meaning your application will not need to continua
by bestows 10y ago
Have a look into websockets. They are used to create an always open connection between the client and server. Meaning your application will not need to continually poll the server for updates.
- stephenr 10y agoFor notification type stuff (i.e. predominantly one way, server > client) Server Sent Events/EventSource is IMO a simpler, more appropriate solution: It works over regular HTTP and has a built in method to tell the server the last seen message (i.e. to allow replaying old messages), and exposes the event type (i.e. the event: field in the event block sent from the server) for use with addEventListener in the browser. It's supported by all non-MS browsers, and because it works over regular HTTP, it can be polyfilled in IE/Edge using long polling XHR.