Applications and Features of Socket io



Features of Socket io , Socket io Features

In this post, we going to see what are the main features of the Socket io and see why it is the most powerful client-side library for Real-time applications.

Socket io gaining popularity very quickly nowadays. Since I mentioned in my previous post that it implements the concept of bi-directional event driven based environment for communications between client and server.


It consists of two of its main library:

  1.  A Node js server library.
  2.  A Node js client library for the client(browser).

Actually, Socket io replaces the concept of AJAX long-polling that is used for fetching server-sent data for an application though it was very slow and not ideal process.

Socket io is an event-based bi-directional communication layer for a real-time web application built at the top of Engine.io.


Main Features are:


Reliable : For socket io client and server side library,connection reliablility is important. Connection are established even in both presence of  Proxies and load balancers and Personal Firewall and Antiviruses software.

Rooms and Namespace Support:Socket io makes two very efficient and convienent implementation like Rooms and Namespaces. Namespace allows to all your socket connection giving different end points or path.This feature is helpful in minimizing the no of resources(TCP connections) while in each namespace ,there is concept of arbitory channels called Rooms which can be join or leave.

Auto Reconnect Feature :Socket io supports for auto reconnection facility.Even a disconnect event occurs,client also have an option or facility to reconnect with the server again.

Detection of Disconnect Mechanism:For the client disconnection mechanism,an heart beat concept is implemented at the engine.io level through which we can find whether server or client is not responding anymore.

Very Simple Implementation API:Sample Code -

io.on('connection', function(socket){
  socket.emit('request', /* */); // emit an event to the socket
  io.emit('broadcast', /* */); // emit an event to all connected sockets
  socket.on('reply', function(){ /* */ }); // listen to the event
});
Cross Browser Support:Socket io support for almost all browser like Google Chrome,Mozilla Firefox,Safari,Opera etc.

So, these are some important and core features of Socket io that makes him very powerful for making a real-time application.

Using socket io we can make some really cool and useful real-time application like:

  • Push Notification: Using socket io library, we can make a real time push notification system for different web and mobile applications.
  • Real Time Messenger: Chat apps like facebook, WhatsApp, hike, yahoo chat messenger etc which does not need to refresh again and again and get instant messages.
  • Online Games:  Games like call of duty,mini-militia, counter-strike etc.

These are some useful and powerful features that make socket io very popular in making real-time applications.



Thanks for reading this post.You have any doubt you can ask in the comment section below.








Comments