what is socket io

0 votes
Jul 17, 2019 in Others by shubham
• 7,340 points
1,740 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, 2019 by sunshine
• 1,300 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 22, 2018 in Others by Frankie
• 9,830 points
1,591 views
+5 votes
6 answers

what is artificial neural network?

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

answered Dec 17, 2018 in Others by Raghumishra
• 240 points
2,861 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, 2019 in Others by Priyaj
• 58,020 points
1,182 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, 2019 in Others by Junaid
1,544 views
0 votes
0 answers

what is socket.io?

Jul 17, 2019 in Others by shubham
• 7,340 points
609 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,890 points
982 views
0 votes
1 answer

What is a callback function?

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

answered Jun 13, 2019 in Others by sunshine
• 1,300 points
1,173 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, 2019 in Others by sunshine
• 1,300 points
1,074 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP