Re – Rethinking Http :)
My friend and colleague , Vishal had these questions after reading this post of mine.
a. What do we mean by Half Duplex and Full Duplex?
These are communication jargons back from my electronic engg. days :)
A half duplex communication is a two way communication between two devices. But these two devices cannot communicate at the same time. In other words you can either transmit or recieve at a time but not both. A very good example is walky talky communication.
Colonel Vishal : Hello Capt. kgthegreat. What are you working on? Over.
Capt. kgthegreat : Hello hello , Colonel Vishal. I am still working on accesibility. Over.
You hit the transmit button and say something and then say over to signal the end of transmission and release the transmit button. Now the other party repeats the same protocol to transmit.
A typical example from our software world will be a strict client server interaction. Firstly a handshake is done between the client and server. Then Client sends a request. Server recieves and then sends a response back. The HTTP protocol is designed the same way. You have HTTP request and response objects.
Whereas a Full Duplex communication is more like a modern day telephone conversation. You can transmit and recieve at the same time. Jonas Jacobi talked about getting this behaviour in HTML 5 Commmunication protocols.
Find more information here.
b. What exactly is Web Sockets?
Web Socket is a new Full Duplex interface defined under HTML 5 Specifications. And yes it is a protocol just like HTTP is a protocol. Like HTTP , if implemented , it will sit on top of TCP/IP Layer.
So instead of ” http : //www.kumargaurav.info ” you will have ” ws : //www.kumargaurav.info ” if implemented.
I will let the people who helped creating it talk more about it.
Here is an excellent FAQ on websockets if there are more questions (which is a healthy sign).
Go here for HTML 5 Specifications which is work in progress.
Go here to know more about the most common network protocol.
Another general reading which I can suggest and personally endorse is Andrew Tanenbaum’s Computer Networks. Its a life changing experience :) .
c. Are we trying to say that Web Sockets is/are going to replace HTTP protocol?
No and Yes. No because it will take time (I think it is envisioned to be completely implemented and accepted by 2020) and yes because it is the right thing to do. Another compramise in this direction is to make WebSocket sit on top of HTTP but I don’t know how good is that.