So that I have all the connections of each of the clients with the name in in this particular client's
dictionary so I can use them anytime I want.
So I can just say are we here for the minute I get data.
I need to save for every client in clients for every client and clients.
All I need to do is I need to send it to their connections to their respective collections and their
respective connections are stored in clients of sorry inclines us inclines us their particular client
of their particular dictionary the name of their particular name.
So Cline's of client so client is already their name.
Right.
Because you just went through all your keys clients of client God docs and all that send all.
I just need to send the data which I just got from this client's data.
Dot dot dot encoded just encode it and set it right.
I sent it to each of the lines.
Right.
But when I send it don't just send data.
OK let's send a message complete message so let me clear the message.
Message will be the name the current name of this particular client.
The client name plus Let's put a call in with a space.
And along with the name I need to send Also the data that this guy is saying.
So they thought let's decode it.
OK let's decode sorry not in code.
Oh I'm sure in code That's what have you received.
Right.
So what have you received from the particular client connection.
Correct.
So data that decode not encode and suicide.
So I'm going to decode and whatever it is that I need to send it to all the other clients.
So whatever I have got the message the message is in a string.
So I just send the same message that message does encode messages a string right
so up there.
I have sent the message along with the client names so that will come up there on each of the clients.
But I do not need to send it to the same place.
OK so we come to that a little later.
OK so we have completely finished up with the client's name that de-code.
All right.
Now let's in the Cline that we buy all I have to do after the name is I need to have all these functions
receive and send it same as the previous one def send send data and receive data.
I have both of them active send the reseeded or what I can have is let's say let's here we're here.
I'll say so in the reseeded or what I can have this I can have for which.
The C-s dot receive invites started Nehra ended up saying Dehra that de-code correct.
And what we get from here.
Take it from the user input.
Take it as user input and code it and then send it to C S C S that send all user input taught in code
correct and coded and then send it fine.
So let's say this is about user input in code and then send it to the particular.
This needs to be sent again and again and again and again hence you need to have one while she is great.
So you can just print that.
You don't need to say from where you got it because the server is already doing that and sending it
to you.
OK.
So with this we have finished with the deaf send data.
Let's say we hear all I need to do was I need to create a thread.
So when I create a thread it is going to ask me to import that from threading Imphal thread and when
I create a thread all I need to do is let's say Fred and I need to say Target Target what what am I
going to talk.
I need to truncate or let's say I get that and that's when I started in T did not start.
Right after you cheated Studd all I aim to do is afterwork do not start I can I can call Senderos in
the main trick.
Right.
So this is about the client side and the server side.
So I need to stop the previous server.
Otherwise it will not work.
So both of them are so close all disclose everything and moves to a new.
So let's see if it works if it doesn't.
We'll have to make a few changes.
So let's do that control should 10.
The server is waiting.
Let's see if a client can up to.
A controller destined for the client and here name let's say x y z.
And to so it has got a connection from client address this thing.
OK let's run another client up.
So run one more client.
So this guy's ABC let's say got a client.
So we got another connection.
OK.
And one more client.
Let's say you are all right.
So I got a connection from clients so we can treat clients rather than the room.
OK so fine one will say Hi guys.
But it doesn't get printed.
So what's the error.
Let's say no.
So we made a mistake somewhere in thread one so in Thread 1 there's the particular line line 14.
So this the critical line message got in code.
So you had the name Cline's of client has no attribute in code message message was client name which
I had taken in OK client name class how it's not a comma.
It's a plus.
And so we made a mistake out there.
Cool so which means you have to stop all of them and rerun things out there so stop all of them and
close all
round the server once again control to death then.
And let's open up the client the PBI control ship death 10:00 a.m. ABC hoping fingers crossed no errors.
P Q R and of course you're going to have one more client that's x y z.
Sorry.
Here.
Three clients.
OK.
All of them connected.
So let's say it says hey guys oh ABC got ABC got himself saying hi guys.
And the other two also got saying ABC is hi guys let's say let's say X Y Z says hi so x y z got from
both the ends crazy gets printed on both the client saying hi rate Well of course when X Y Z sends a
message high x y z himself should not get the message back.
It should really go to the other two clients it should not come to himself.
So what should be the change in the program let's stop everything.
Let's stop all of them and stop all these.
All of them and close everything.
And what triggered the change that I need to make.
So all the change that you do is I should not send it to all the clients clients of clients and all
if I should say if if a client that you have is equal to or equal to the same as the client name that
I've got from is the same as the client name which I have passed or if it's not.
So it is not equal to if they are not equal to then send it if they're equal don't say it.
So this is something which I need to say.