1
00:00:00,330 --> 00:00:05,880
As in previous years, we have seen only the client side programming like we are going to connect to

2
00:00:05,880 --> 00:00:06,460
the server.

3
00:00:06,480 --> 00:00:11,390
But in this video, we are going to write the server code in the python and also the client code.

4
00:00:11,610 --> 00:00:16,650
And then we will see how we can receive the message from the screen and how we can send from send messages

5
00:00:16,650 --> 00:00:17,310
from the server.

6
00:00:17,640 --> 00:00:25,410
So this is very helpful if you want to spin up a server very easily and you can also create the researchers

7
00:00:25,410 --> 00:00:28,470
using this server python file.

8
00:00:29,130 --> 00:00:33,060
So I will just show you the demonstration in the next video of the rehearsal.

9
00:00:33,090 --> 00:00:35,610
So for that, this video is the pace.

10
00:00:36,060 --> 00:00:39,330
So it's just soccer programming.

11
00:00:39,330 --> 00:00:45,180
But we will implement that server of logic, let's say Pawtucket.

12
00:00:51,040 --> 00:00:56,350
So now we are going to create the circuit as usual socket is called the socket that.

13
00:01:00,370 --> 00:01:01,830
Soccer, not Aelfwine.

14
00:01:07,560 --> 00:01:12,510
And on the scholarship, because we are going to create the IP version four.

15
00:01:12,870 --> 00:01:14,160
And this is soccer.

16
00:01:14,520 --> 00:01:21,300
So first, in order to start the server, we need to buy into this socket to the IP address and the

17
00:01:21,570 --> 00:01:21,950
number.

18
00:01:22,380 --> 00:01:30,390
So we need to start buying and we need to pass connectable, which is one traditional zero one.

19
00:01:30,990 --> 00:01:32,760
And number three, one, two, three, four.

20
00:01:33,210 --> 00:01:40,600
So on this Alto's an IP address, my socket is going to bind and it needs to run for incoming connections.

21
00:01:40,890 --> 00:01:49,980
So when you say it's not enough, so you need to start off with a number of connections.

22
00:01:49,980 --> 00:01:51,350
So that's pretty connections.

23
00:01:51,360 --> 00:01:53,970
If you want to design for three connections, we can say three.

24
00:01:54,390 --> 00:01:57,220
If you want to run for five connections, you can see a fight.

25
00:01:58,560 --> 00:02:02,330
So now we're up to this to the server goes on resetting.

26
00:02:02,520 --> 00:02:06,960
And if there is any connection in going to the server, we need to accept that.

27
00:02:06,960 --> 00:02:13,220
You need to say it's not acceptable and this will return to objects.

28
00:02:13,410 --> 00:02:16,980
That is, one is the current socket of object.

29
00:02:17,310 --> 00:02:25,470
And the address of this, uh, kind of in four does so this C is the crown, the socket.

30
00:02:25,510 --> 00:02:26,250
We can deal.

31
00:02:26,580 --> 00:02:32,870
We can send the messages to this client using this C and this is just the address of the screen.

32
00:02:33,270 --> 00:02:40,400
Now we can put in the address that services received from connection with your.

33
00:02:51,790 --> 00:02:55,700
So we're just going to print that the address here.

34
00:02:56,260 --> 00:02:58,680
This was in connection with you from this address.

35
00:02:58,840 --> 00:03:06,770
We can also logon to this information into this log file to make sure that what connections are you

36
00:03:06,790 --> 00:03:07,300
are getting?

37
00:03:10,250 --> 00:03:20,160
So now we got this kind of that we can just see what to see or we can see we can send the banner, right?

38
00:03:20,330 --> 00:03:24,380
We are the Saarbrucken Savannah visitors to High.

39
00:03:25,810 --> 00:03:28,690
This he's served for.

40
00:03:32,250 --> 00:03:39,390
So we can send this banner, so see that send off banner?

41
00:03:39,900 --> 00:03:44,420
We need to send it as whites to do that, we need to encode this message.

42
00:03:46,140 --> 00:03:52,700
So now my banner will be sent on to the screen whenever the screen gets initiated.

43
00:03:53,220 --> 00:03:54,480
I mean, gets connection.

44
00:03:55,230 --> 00:04:01,010
This banner will be sent to the ground and then we can simply close the connection.

45
00:04:01,500 --> 00:04:02,910
I'm just showing the demonstration.

46
00:04:02,910 --> 00:04:07,990
No, you can just simply say green dot cross and socket of the dot cross.

47
00:04:09,600 --> 00:04:10,040
All right.

48
00:04:10,050 --> 00:04:17,220
This is our server code and we are going to create the grindcore record with the first two lines and

49
00:04:17,220 --> 00:04:18,220
paste it in here.

50
00:04:19,800 --> 00:04:21,540
Now we need to connect to.

51
00:04:24,140 --> 00:04:24,860
This

52
00:04:27,260 --> 00:04:30,620
IP address and the post, no record with these two.

53
00:04:33,740 --> 00:04:39,980
So now you're going to connect to the server as soon as we connect to the server will get the message

54
00:04:40,010 --> 00:04:43,760
because the server is sending the burner and we need to see this.

55
00:04:43,760 --> 00:04:51,690
That same message comes to a slot receiver of a letter to for red particle.

56
00:04:53,780 --> 00:05:01,120
And we are going to put into this message and we can just set StarCrossed.

57
00:05:03,140 --> 00:05:07,940
So now we are going to run the server because we run the line first.

58
00:05:07,970 --> 00:05:13,290
It will not connect to our IP address because server is not easy.

59
00:05:13,550 --> 00:05:17,830
So I'm going to run this server in the virtual you call an ATM.

60
00:05:17,900 --> 00:05:19,660
You cannot run this play.

61
00:05:23,170 --> 00:05:24,460
So are you spending Mr.

62
00:05:25,060 --> 00:05:31,510
So my server is going unbinding this IP address and phone number and also it started resiting.

63
00:05:31,820 --> 00:05:36,580
So what I will do is I run this kind of script using this integrated running new and.

64
00:05:37,930 --> 00:05:39,200
So now this is my code.

65
00:05:39,220 --> 00:05:40,120
I can still run.

66
00:05:45,330 --> 00:05:46,130
Ganzouri.

67
00:05:50,140 --> 00:05:53,840
So I just copied the same code red that's got the same error.

68
00:05:54,590 --> 00:05:55,330
All right, no good.

69
00:05:55,340 --> 00:05:56,810
It's Gordon Brown this.

70
00:06:03,420 --> 00:06:07,660
So let's run this and we can see.

71
00:06:08,580 --> 00:06:15,570
Hi, this is Sarah and you can see the connection received from this IP address and the phone number.

72
00:06:15,570 --> 00:06:22,590
So this client is going to connect to this server using this IP address and the number five two three

73
00:06:22,590 --> 00:06:23,000
zero four.

74
00:06:23,250 --> 00:06:28,490
And this phone number is used by Cottonelle, which is are we to this the random report.

75
00:06:29,850 --> 00:06:33,580
So this is the basic way of broadening support.

76
00:06:34,320 --> 00:06:44,950
Now, let's implement, uh, the like say we put the loop and we implement Rijad server.

77
00:06:46,560 --> 00:06:54,140
So after sending the banner that, uh, we need to send this message, so on the server side will keep,

78
00:06:54,280 --> 00:07:04,020
say, message calls to see that receiver of two zero for red dot vehicle.

79
00:07:05,730 --> 00:07:10,800
So now after sending the banner, we got the we received a message from the grant.

80
00:07:10,800 --> 00:07:17,900
Right now, let's keep the WI loop while message not equals.

81
00:07:19,350 --> 00:07:21,160
So I'm simply choosing good.

82
00:07:21,510 --> 00:07:28,410
So if the client sends a good message, it means that it's going to open the connection.

83
00:07:28,410 --> 00:07:42,180
So other I can say, uh, while message is not easy to get good, uh, we can print that message, print

84
00:07:42,190 --> 00:07:51,900
that message, and we can also ask the user input and you can also send the data.

85
00:07:51,900 --> 00:07:57,060
That's a message that calls to and put off.

86
00:08:01,610 --> 00:08:02,510
And there's something.

87
00:08:04,040 --> 00:08:08,880
And something and then, uh.

88
00:08:11,020 --> 00:08:16,470
Yes, not send off message, not an and.

89
00:08:21,030 --> 00:08:27,090
All right, I think this is the car, so first we're receiving the message from the Clinton budget and

90
00:08:27,090 --> 00:08:29,710
then we are printing whether it is not good.

91
00:08:30,510 --> 00:08:36,060
Uh, we are going to print the message and ask the input from the server side, and we are going to

92
00:08:36,060 --> 00:08:37,620
send that message to this.

93
00:08:38,390 --> 00:08:42,740
We need to put the seat and we are going to send this to the ground.

94
00:08:42,750 --> 00:08:46,400
And again, we will receive this message.

95
00:08:48,180 --> 00:08:53,240
So we need to put this one so we will receive the message again and again, check whether it's not quite

96
00:08:53,430 --> 00:08:54,300
good or not.

97
00:08:55,290 --> 00:08:59,290
So the opposite should be done in this current.

98
00:08:59,340 --> 00:08:59,630
Ropy.

99
00:09:01,710 --> 00:09:02,640
So first.

100
00:09:03,960 --> 00:09:08,910
We are sending the Bernadotte, took the crime to the zoo, and then we need we need to send a message,

101
00:09:08,940 --> 00:09:09,240
right.

102
00:09:10,500 --> 00:09:14,970
USIP message is equal to in backoff.

103
00:09:17,140 --> 00:09:18,340
And to some degree.

104
00:09:25,080 --> 00:09:30,650
And we are going to say yes, not send off message to.

105
00:09:33,100 --> 00:09:33,760
And Michael.

106
00:09:36,430 --> 00:09:43,930
So we are going to send this message to the server and it will be received at this late date on what's

107
00:09:43,930 --> 00:09:46,740
it going to print and we are going to receive this connection.

108
00:09:57,270 --> 00:10:07,110
And while we not as equals to quit, we are going to receive the message from the server because there

109
00:10:07,110 --> 00:10:12,030
is the send the matter and we are going to receive this one.

110
00:10:16,810 --> 00:10:23,530
So as you can see, we're riding exactly the opposite of that while we are extending and receiving,

111
00:10:23,830 --> 00:10:27,980
if you send from one other side, you need to see what other are and vice versa.

112
00:10:28,360 --> 00:10:32,510
So we are sending here the loop and we are receiving it here.

113
00:10:34,270 --> 00:10:40,660
Now, let's go and put into this message so our client will read their message and then.

114
00:10:43,290 --> 00:10:50,650
It will be displayed on the ground and then we need to send another message that we need to just simply

115
00:10:50,650 --> 00:10:57,820
copy this court order here and we are again asking the user for the input into something and he will

116
00:10:57,820 --> 00:10:59,590
enter the input and we will send.

117
00:11:09,650 --> 00:11:15,860
And this grant will send a message to the, uh, this sarva.

118
00:11:18,690 --> 00:11:21,630
So I think that's all for this, right?

119
00:11:22,050 --> 00:11:26,230
I think it will work, even though this does not work, we're going to devote the program.

120
00:11:26,310 --> 00:11:27,530
This is just a demo.

121
00:11:28,830 --> 00:11:32,870
So my server is going on running on this morning.

122
00:11:34,980 --> 00:11:42,900
So we got the connection with you from this, um, client that is this one and or something that's that's

123
00:11:43,770 --> 00:11:44,010
know.

124
00:11:45,840 --> 00:11:47,540
And you can see here we got Darlow.

125
00:11:47,940 --> 00:11:49,020
Let's say something.

126
00:11:50,790 --> 00:11:52,350
Good morning.

127
00:11:56,190 --> 00:12:03,110
And you can see the good morning here, Piggins, let me put this off screen and or something, and

128
00:12:03,110 --> 00:12:16,560
I can tell all you can to cover and here like this, you can implement the, uh, server, but it will

129
00:12:16,560 --> 00:12:20,990
be better to open another socket for bidirectional communication.

130
00:12:21,220 --> 00:12:23,060
Yeah, this is only a single directional.

131
00:12:23,370 --> 00:12:27,640
That means only one can send at a time just because we wrote the code.

132
00:12:27,870 --> 00:12:30,570
We can also implement the bidirectional.

133
00:12:30,660 --> 00:12:33,180
But the just overwhelming.

134
00:12:36,420 --> 00:12:39,020
So this is far all of this video.

135
00:12:39,050 --> 00:12:43,750
I'm just going to call this one, so that's all for this video.

136
00:12:44,280 --> 00:12:46,680
This is very important for the next two years.

137
00:12:46,710 --> 00:12:52,950
That is what we're going to do, is we are we are going to receive the message from the client and we

138
00:12:52,950 --> 00:12:56,070
are going to execute that message as a comment.

139
00:12:56,400 --> 00:13:03,920
If the Grandison are less than that, will be executed as a comment, and then we will send it to Russia.

140
00:13:04,290 --> 00:13:06,860
So that's what we are going to do in that next studio.

