Are sockets just a connection between 2 machines?
And if sockets can be established why do we even use HTTP connection?
Http is a protocol built on top of sockets.
When you use Http, you're using a higher level of abstraction on top of sockets. You're still using sockets.
It's kind of like saying "Why would you use a .xyz document when you could just use a file?"
Lets say that socket is just a stream between 2 remote systems which uses TCP/IP or maybe UPD lower level protocols for transport data. And HTTP is the higher level protocol which specifies HOW systems are communicating.
Small example: air is a transport level for voice, but you need words (an upper level protocol) for communication with other ppl.
But better for you to read here: http://en.wikipedia.org/wiki/OSI_model
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With