The communication between computers on the Internet and within local area networks relies on a layered set of protocols, the most important being the OSI reference model. Protocols, in terms of networking are a set of dictates and standards that are adopted across all machines to enable them to communicate with one another. They are essentially a set of rules for the handling of packets of data and requests backwards and forwards between computers across a network. The OSI (Open Systems Interconnection) model has been in use since 1983, and the majority of computers, networking peripherals, network hardware, network enabled devices and IoT devices use this model.
The OSI reference model uses a protocol stack, which is an abstraction of the actual networking operations, that enables the protocols to be explained and applied more effectively.
Typically in a communication across the Internet, a client machine (web browser) will send a HTTP request to the web server and a response will be send by the server to the client, and then this opening of the communication is finalised.
HTTP (HyperText Transfer Protocol) is part of the TCP/IP grouping of protocols. This sits in the network transport layer, and enables for the majority of communication around the Internet.
Typical communication requests for HTTP include GET, POST, PUT and DELETE, and these are standardised through the use of APIs and front end web applications. APIs typically are the software that handles the passing through of these requests to the client and different types of information requests are standardised through the creation of these application programming interfaces. The client machine will push the request through a data packet to the web server, the web server will then acknowledge the client, perform the necessary operations internally, and then initiate another request to send through the information. Each of these SYN/ACK communications are singular, and closed once completed.
Sockets.IO enables the communication between client and host to stay open, without having to close off an open connection. The connection stays live, and therefore once handshaking and verification has occurred, the realtime connection is enabled. Sockets.IO is a javascript framework that makes it far simpler to implement real-time communication. Previously it was extremely difficult to implement applications such as chat apps, because the client would have to keep polling the server, keeping an eye on timestamps and performing audits to ensure that messages were sent sequentially, and it was extremely heavy on network resources.
Javascript is a widely implemented coding language to enable websites to function as applications. HTML websites were once simply static, but languages such as Javascript enabled the creation of web applications. A few different frameworks such as React Native have been developed to enable the conversion of HTML5, CSS and Javascript to be converted to native smart phone applications. Sockets.IO can be integrated into both mobile and web applications for the purposes of keeping open real time connections.
Websockets are a new technology that has upgraded the functonality of static HTTP websites. Websockets work by passing through an upgraded header from the client to the server, indicating that an open communication channel is being requested. It is built partially on the secure HTTPS protocol, and has enabled for an improved user experience with respect to the speed of real time applications. It avoids the need for persistent polling of the client machine to the web server, improving speed and efficiency. Websockets are described as a bi-directional, full duplex communication channel between the client and server. This works over and above the single direction standard HTTP request.
Sockets.IO extends the functionality of Websockets, and as a Javascript library offers a lot of features for the software engineer to implement. It can work as a wrapper of Websockets, and makes the utilisation of this technology far more efficient, as is typical for the implementation for a framework. Given that the introduction and explanation of these technologies has been offered, it is now time to present the ten different reasons (or amazing ways) you will love Sockets.IO as a developer.
chat applications
real time multiplayer games
real time feeds and updates
video chat and voice chat
real-time location tracking (need to know how far away my Uber Eats delivery is!)
Internet of Things (yes, my vacuum cleaner is working well and avoided the dog)
real time sports and event updates
live updates on user behaviour within an application
e-learning applications
concurrent collaborative editing of documents