Web Sockets Vs HTML Protocols
Hi friends, today I want us discuss something little on web sockets and html. I want us to understand what they are and how they differ. Enjoy the ride with me.
We probably all understand that both are communication web protocols. If not then that is what they actually are.
They differ in the way they provide the communication.
Imagine crossing a narrow bridge against a wide one. There are guys on the other side and you and friends on one side. For the narrow bridge, you either have to wait for the other guys to cross before you cross or they have to give you the courtesy. But for a wide bridge, you don’t have to wait. You can all of you cross to either direction.
Having said that, let us relate. For HTML communication between the client and server is half duplex. Opps! What is this again? half duplex means one direction communication at a single time. Meaning, the client opens a connection to the server for a request and the server opens its own connection for the response. What this means, many connections made. And as a result there is a lot of overhead.The whole idea is actually called polling.
But for web sockets it is different. It is full duplex or simply bidirectional. The server and the client can communicate with only a single connection. As a result, no side waits for either to complete communicate. This way, communication between the server and client becomes easy. And real time communication is realized.
Guys, it is that way. See you in the next discussion.