OK so in this lecture we are going to do the same process.
I am going to create a new package called handle connection.
So now in this package you create a function called the next to it.
That would include.
And similarly it's going to take two things IP which is of type String and port which is our fates linked
to.
And then it is going to return connection which would be applied in at dot com and then an arrow which
will do the F type error.
Now
the next thing we want to do is move want to dial the server.
So I'm going to copy this line Okay I'm going to copy everything from here.
Let's just take this it here and then we need to convert this IP in port into this server address.
So I'm going to copy this as well.
So let's call it subtle IP.
Whoops.
Now we have almost everything set up.
So I'm going to move this and I'm just going to call to turn here similarly if everything is successful
I'm going to return it to so if there is an ad of in connection dialing then we will simply turn an
empty connection and and that ad which contains the ad restates that is in Florida.
This photo not connecting this.
And then if the f everything goes well we would turn this connection object which contains a connection
to this network.
Now come here we need to define the IP addresses which we have already defined here.
And we have to define port which is here and then we need to handle the connection.
So I'm going to call Handel connection
that connect with hacker.
And then what we need to do is we need to provide the IP which is going to be server IP and then port
and then they drew and connection and add a
connecting we just need to handle letters if that is multiple and then long term.
And if everything goes well we just print out.
But first we need to close the connection properly and then we can print out whatever statement is for
example from true doctrine to land connection established.
So
and then the same IP address which would be a connection at the motor trust string.
So now we have everything centers malware and just run these big guns to see that they're working properly.
So let's go to the lending to him and it's leveraged and then go on and go.
Now you can see that this is ratings which means that it's working properly.
Let's go to the Windows machine theorist again and then go on that.
Go it for a few seconds
on long it's going to take OK.
So now the connection is established.
So as you can see that it is connection established its server design.
And if you go to the server you can see that you get the IP address of the victim which is Zero Dark
Thirty and then the port it uses to connect.
So now we know organized our code properly.
Now in next lecture we will build on top of that and start creating more functionalities in this code.
So that's it for this lecture.
See you next lecture.