Wrap Up
Let's highlight the main contents of this chapter.
We'll cover the following
Key takeaways
Let’s take a moment to reflect on what we’ve learned in this chapter:
- AJAX polling is a technique applied in AJAX applications where the client opens a connection with the server and then repeatedly sends HTTP requests to a server at regular intervals to get any new information the server has.
- In long polling, the client opens a connection with the server and makes an initial HTTP request but doesn’t expect the server to respond immediately.
- WebSocket creates a persistent, bidirectional communication session between the user’s browser and a web server. Socket.IO can be used to build various applications with real-time communication capabilities, such as streaming applications, document collaboration, and instant messaging. Socket.IO uses WebSocket as a means of transport when the WebSocket API is available in the browser, falling back on HTTP long polling if it’s not.
- Socket.IO uses events to facilitate data transfer between the client and the server. Every event consists of two sides, the sender and the receiver. If the server is the sender, then the client is the receiver. If the client is the sender, then the server is the receiver.
Get hands-on with 1200+ tech skills courses.