WEBVTT

1
00:00.640 --> 00:02.160
Hi everyone!

2
00:02.480 --> 00:12.680
In previous video, I already showed you the simple chat application using the normal http.

3
00:14.680 --> 00:20.280
So in this video let's close the look at.

4
00:23.520 --> 00:29.320
In this video I will talk about the TCP handshake.

5
00:31.800 --> 00:40.240
And you may ask me why I don't teach use the some library like Socket.io.

6
00:40.960 --> 00:44.560
Jump right into the websockets.

7
00:46.720 --> 00:58.600
Well, I can easily do that, but I want you to become a great developers.

8
00:58.880 --> 00:59.400
Okay.

9
01:01.640 --> 01:08.660
I don't want just show you the syntax, you can find syntax everywhere.

10
01:09.500 --> 01:09.980
Okay.

11
01:10.340 --> 01:14.980
I want to have a core concept.

12
01:17.060 --> 01:17.580
Okay.

13
01:17.620 --> 01:20.060
And understand the fundamentals.

14
01:20.660 --> 01:24.380
So for that reason I will teach you all of that.

15
01:26.020 --> 01:30.180
Well let's understand what is this TCP handshake

16
01:30.860 --> 01:42.020
As you can see right here, in order to send the http request into the server, before the client can send

17
01:42.020 --> 01:51.220
the request into the server, it should be established the TCP handshake.

18
01:53.220 --> 02:04.980
What's it mean right now is before the client can send the request into the server, it should establish

19
02:04.980 --> 02:06.560
the TCP first.

20
02:07.560 --> 02:12.040
Well, how's it established the TCP?

21
02:12.760 --> 02:20.120
Well, firstly the client, it will send the sync into the server.

22
02:20.560 --> 02:21.120
Okay.

23
02:21.560 --> 02:26.120
And from the server it will return back into the SYN.

24
02:28.320 --> 02:30.560
And acknowledgement.

25
02:31.320 --> 02:31.840
Okay.

26
02:32.120 --> 02:44.960
And after that the client it will confirm it using the another request with the ACK okay.

27
02:45.560 --> 02:49.400
This thing will be the three way handshake.

28
02:50.200 --> 02:53.520
Of the TCP, okay

29
02:53.800 --> 03:02.960
Only after three steps we can send the normal http.

30
03:04.880 --> 03:05.440
Okay.

31
03:05.840 --> 03:12.580
So that's it, HTTP is built on top of the TCP.

32
03:12.860 --> 03:17.220
Okay, so for a reason before the http can send a request.

33
03:17.660 --> 03:18.500
We should.

34
03:20.740 --> 03:23.940
Establish the TCP first.

35
03:26.220 --> 03:35.580
And all of that is already done behind the scenes when we use the some frameworks.

36
03:35.780 --> 03:36.220
Okay.

37
03:37.820 --> 03:41.900
But I want to have an idea about that.

38
03:44.900 --> 03:48.940
And you can see HTTP is stateless.

39
03:48.980 --> 04:00.940
It means when the http request and respond, it will be disconnection okay.

40
04:01.060 --> 04:03.180
This will be clearly disconnection.

41
04:03.820 --> 04:07.780
And right here I talk about stateless.

42
04:08.420 --> 04:09.820
What is stateless.

43
04:10.820 --> 04:23.000
Stateless, it means the next request doesn't know anything about the previous request.

44
04:23.040 --> 04:29.040
Okay, it doesn't have any memory about the previous request.

45
04:29.560 --> 04:30.080
Okay.

46
04:31.240 --> 04:39.640
It means when client send a request to the server and server respond back to the client, it will be

47
04:39.720 --> 04:42.600
done and it will be removed.

48
04:43.800 --> 04:47.440
So in the next time when we send another thing.

49
04:51.000 --> 04:52.440
It will doesn't have anything.

50
04:53.040 --> 04:55.600
It will doesn't know anything about previous.

51
04:56.440 --> 04:56.880
Okay.

52
04:57.240 --> 04:58.720
That's about the stateless.

53
05:01.080 --> 05:10.280
But right now, even if the request and response are disconnected, the TCP is still there.

54
05:10.880 --> 05:13.520
This is the persistence connection.

55
05:14.520 --> 05:15.040
Okay.