WEBVTT

00:00.510 --> 00:02.570
All right let's run this code right now.

00:02.620 --> 00:06.860
Let's let's go on to this quick control chip.

00:06.860 --> 00:12.050
Def Dan are you can you can just see run.

00:12.120 --> 00:15.740
So when you say run it will go to the server.

00:15.810 --> 00:23.010
So it says only one usage of each socket address is normally predicate permitted which means 1 2 3 4

00:23.010 --> 00:26.580
is already being used somewhere.

00:26.760 --> 00:29.130
And so I need to change that.

00:29.160 --> 00:32.400
Let me call this 2000.

00:32.510 --> 00:34.310
Let me check if this works.

00:34.380 --> 00:36.150
Control shift 10.

00:36.150 --> 00:36.450
All right.

00:36.450 --> 00:38.730
So 7 0 so is bound to port.

00:38.730 --> 00:41.350
It says I wanted to see if because I put it up here.

00:41.600 --> 00:43.680
What I can do is I can just stop this

00:47.240 --> 00:50.810
I can just put this as a number.

00:51.350 --> 00:59.110
I'll create a variable whenever I CHANGE YOUR should be reflected everywhere right.

01:00.160 --> 01:03.280
And to put number why to put.

01:03.300 --> 01:06.640
Come on post number whatever is number.

01:06.710 --> 01:07.290
Right.

01:07.390 --> 01:14.470
So I saved this control ship Destin soberest bound to port number 2000 servers listening for clients.

01:14.680 --> 01:21.840
Now client is going to connect to the server at port number 2000 localhost.

01:21.850 --> 01:22.510
OK.

01:22.540 --> 01:27.640
So we want to run this to see control of that 10 for this one to the minute you run that.

01:27.920 --> 01:31.670
Oh it's all recreated and it finished also.

01:32.230 --> 01:36.270
We didn't put any print statements so there is no nothing to print out here on the server side.

01:36.390 --> 01:36.850
OK.

01:36.880 --> 01:43.860
Got a line from address wonderly 7.0 appointer of 1 1 and that plane was at the port number of 68 unifor.

01:44.080 --> 01:48.250
And then what is the message that was sent from the client the messages that are sent from the wind

01:48.250 --> 01:50.120
was high so were I'm inclined.

01:50.170 --> 01:55.780
You said that you got that here on the server side because on the server side you are taking that data

01:55.780 --> 01:59.420
from the client data from the client can receive.

01:59.620 --> 02:04.060
And then you have printed the data or data decode and then you would close the connection and close

02:04.060 --> 02:06.380
the server socket or close.

02:06.670 --> 02:07.360
Right.

02:07.360 --> 02:12.270
So these are the few things that we need to see and we do want to step.

02:12.460 --> 02:13.450
OK.

02:13.450 --> 02:18.410
All right then and now let's understand a few things.

02:18.430 --> 02:18.690
OK.

02:18.700 --> 02:26.050
I want to create something like you know if I want to send some data back from the server to the client

02:26.800 --> 02:36.220
what would I have to do before before before the before the closing of kine and server socket what I

02:36.220 --> 02:45.630
need to do is I need to send data which means I need to see it kind of send all what I need to send.

02:45.940 --> 02:48.660
I need to send it to the client.

02:48.700 --> 02:51.250
So which is the client.

02:51.370 --> 02:52.530
I'm sorry.

02:52.750 --> 02:53.590
I understand the data.

02:53.590 --> 03:00.240
What does the data have from silver dot encode.

03:00.280 --> 03:02.540
You need to put it into bytes right.

03:02.650 --> 03:06.270
And by default it is UTF it cool.

03:06.630 --> 03:11.820
Now you did the send all you need to accept the point.

03:12.040 --> 03:19.510
So let's say I have a client after sending it has to wait and receive.

03:19.510 --> 03:24.530
So you need to wait and receipt so when we receive.

03:24.530 --> 03:28.270
All he can do is wait for how many bytes.

03:28.280 --> 03:42.580
Let's say thousands take that into data take the data and let's say print data dot decode.

03:42.790 --> 03:43.680
Correct.

03:43.720 --> 03:50.590
So if you would first of all the Schober needs to be stopped all servers stopped already.

03:50.590 --> 03:52.460
OK let's run the server once again.

03:52.610 --> 03:55.990
Drillship def then the server is listening for clients.

03:56.230 --> 03:59.480
The client is OK.

03:59.560 --> 04:01.910
Let me run this out here from server.

04:01.950 --> 04:04.280
It's come on the client server side.

04:04.380 --> 04:04.970
Hi sir.

04:05.020 --> 04:05.590
A client.

04:05.770 --> 04:08.580
Both sites data is going here and there.

04:08.670 --> 04:09.050
Right.

04:09.240 --> 04:10.090
But both sides.

04:10.380 --> 04:11.290
It's connection.

04:11.300 --> 04:13.360
Last but remember there is a problem.

04:13.500 --> 04:18.770
You can only send when you send the other guy has to be receiving.

04:19.000 --> 04:25.660
And when this guy sends this guy is receiving but you cannot do both at the same time.

04:25.810 --> 04:30.310
You cannot send and receive at the same time.

04:30.310 --> 04:32.240
Now there comes a problem.

04:32.320 --> 04:36.220
You want to send as well as speech you want to send data.

04:36.460 --> 04:37.440
You want to receive data.

04:37.480 --> 04:42.980
You want to send data receive data from the client from one book things to happen at the same time.

04:43.180 --> 04:47.170
If you want both things to happen at the same time two programs need to run.

04:47.170 --> 04:51.150
That means blind socket that receives complaints are a godsend.

04:51.160 --> 04:58.370
Both of them need to happen at the same time which requires a concept called as we need to go for the

04:58.370 --> 05:00.600
kinds of callers multi-threading.

05:00.730 --> 05:07.060
So we need to understand multi-threading how multi-threading works how two things can be done simultaneously

05:07.060 --> 05:07.990
at the same time.

05:08.200 --> 05:12.920
And then understand how to network in that particular fashion.

05:12.940 --> 05:18.880
So we are heading towards getting a chat operating right where we can chat with one another.

05:18.960 --> 05:20.880
They can we can have a chat operator.

05:20.920 --> 05:25.850
So that's that's where we can head on to and we can we can go on.

05:25.870 --> 05:26.230
All right.
