Hi everyone!
In previous video, I already showed you the simple chat application using the normal http.
So in this video let's close the look at.
In this video I will talk about the TCP handshake.
And you may ask me why I don't teach use the some library like Socket.io.
Jump right into the websockets.
Well, I can easily do that, but I want you to become a great developers.
Okay.
I don't want just show you the syntax, you can find syntax everywhere.
Okay.
I want to have a core concept.
Okay.
And understand the fundamentals.
So for that reason I will teach you all of that.
Well let's understand what is this TCP handshake
As you can see right here, in order to send the http request into the server, before the client can send
the request into the server, it should be established the TCP handshake.
What's it mean right now is before the client can send the request into the server, it should establish
the TCP first.
Well, how's it established the TCP?
Well, firstly the client, it will send the sync into the server.
Okay.
And from the server it will return back into the SYN.
And acknowledgement.
Okay.
And after that the client it will confirm it using the another request with the ACK okay.
This thing will be the three way handshake.
Of the TCP, okay
Only after three steps we can send the normal http.
Okay.
So that's it, HTTP is built on top of the TCP.
Okay, so for a reason before the http can send a request.
We should.
Establish the TCP first.
And all of that is already done behind the scenes when we use the some frameworks.
Okay.
But I want to have an idea about that.
And you can see HTTP is stateless.
It means when the http request and respond, it will be disconnection okay.
This will be clearly disconnection.
And right here I talk about stateless.
What is stateless.
Stateless, it means the next request doesn't know anything about the previous request.
Okay, it doesn't have any memory about the previous request.
Okay.
It means when client send a request to the server and server respond back to the client, it will be
done and it will be removed.
So in the next time when we send another thing.
It will doesn't have anything.
It will doesn't know anything about previous.
Okay.
That's about the stateless.
But right now, even if the request and response are disconnected, the TCP is still there.
This is the persistence connection.
Okay.