what is socket.io?

0 votes
Jul 17 in Others by shubham
• 6,890 points
25 views

1 answer to this question.

0 votes

Before knowing the answer to this question, you must know in client-server architecture how the server used to communicate with the server. Before socket.io there where using short-polling,long-polling, and many others. But the major disadvantage of these was that the communication has to be always initiated with by the client.

For example, if you take short polling, the client periodically sends the request to the server asking if there’s anything update, for which the server responds back with the update or just empty message, without any time delay. but the major disadvantage of this that the network gets congested with these continuous requests, even when there are no updates.

If you take in case of long polling, the client sends the request to the server asking if there’s anything update with a suitable timeout, for which the server would send back a response if there is an update, but here to the major disadvantage is that the client will continuously make the request.

imageTo overcome this we use web socket which has one TCP connection between the client and server always open, to ensure bi-directional communication between the client and server. 

image

Socket.IO is JavaScript implementation to work with HTML 5 WebSockets. 

Where it can use Node.js as a back-end and while using JavaScript, Angular or React for front-end.

answered Jul 17 by sunshine
• 1,240 points

Related Questions In Others

0 votes
1 answer

What is the difference between hadoop and google analytics ?

I will try and answer this as ...READ MORE

answered Aug 21, 2018 in Others by Frankie
• 9,810 points
41 views
+5 votes
6 answers

what is artificial neural network?

Machine Learning is a field of computer ...READ MORE

answered Dec 16, 2018 in Others by Raghumishra
• 240 points
169 views
+1 vote
1 answer

What is the difference between Dark Web and Deep Web?

The content that which you cannot find ...READ MORE

answered Feb 6 in Others by Priyaj
• 56,200 points
61 views
+1 vote
2 answers

What is the different between xml and json?

These are the differences:   It is JavaScript Object ...READ MORE

answered Feb 7 in Others by Junaid
43 views
0 votes
0 answers

what is socket.io?

Jul 17 in Others by shubham
• 6,890 points
11 views
0 votes
1 answer

how to safely deploy npm install without it causing inconsistencies?

The recent versions on npm generates a ...READ MORE

answered Apr 11, 2018 in DevOps on Cloud by DareDev
• 6,810 points
60 views
0 votes
1 answer

What is a callback function?

Callback function is a function which is ...READ MORE

answered Jun 12 in Others by sunshine
• 1,240 points
52 views
0 votes
1 answer

What is the difference between loadash and underscore

Loadash makes iterating arrays, strings, and objects easy in ...READ MORE

answered Jun 21 in Others by sunshine
• 1,240 points
50 views