Hello and welcome to the golden programming language course in the previous session.
We were able to implement the silver layer, and in this session we want to implement the client layer.
So go to Package Expeller and go to website, get folder and create a folder name like Cloudflare Client
Layer and inside it.
Create the file name like client that go layer.
Go
now, set the package name package.
Main.
OK, in this file, we have to do the things related to setting up the client and client needs to connect
to the server.
So define a main method if the first client must communicate with the server.
To do this, we call the dial function from the vets to get package.
The function opens a new client connection to a verb subject.
This function accepts through our unions and return to values first, connection and second and then
all.
So first define to variable like connection and error connection comma error.
Column equals that suggests.
Don't go off.
First argument is a silver address that in this case, it is localhost and we defined a 85 port for
it when we use events to get our protocol is not issued DP type, but it is a double US type.
So we write double quotation marks the Avenue S Column S slash 127.0.0.1 as localhost
column 885 as Port No.
The second argument is specifies the time of port.
Of course, this argument is set when the type of protocol is not as specified in the address.
And since we specified the time of port going into your head, we no longer need to set this argument.
So set a double quotation marks.
And third, human requires us to have an origin where we send the IP class as the origin to the function.
So we have to implement a method to create the IP client, for example, create the function named like
create IP, create IP.
So go out of this function and implement the create IP method.
This function suppose to return estimated value values so we define farm, create IP and return type
is estranged.
Now you should create an IEP, since IEP consists of four parts.
We need to create a four element at eight by the end type.
So we write that IEP for by the Typekit.
Now we want to initialize daddy for do this using end end function from the Randt package, we assign
the random number between zero and two hundred and fifty six to each of the three cells created.
We do this through a follow up to number of the adding members.
It is for forces to set the ADI, so we write for
I call an equals zero I less than
lenn of array and I + +.
In order for the generated number not to be the same, he is the seat function from the and package
seat function uses the provided seat value to initialize the default source to a deterministic estate
and Connie now function of time packaged as argument for it.
So the ride ran don't seat
and calling now function from time package time.
Don't now, don't you need now.
Now, right.
IP index AI equals cunning int in function of Rand Packer's Rand Darts end in fonctionne and set two
hundred and fifty six as argument for it.
Two hundred and fifty six.
Now we create and return IP using the Sprint F function from the FMD package, so we right return T
dot a screen test.
TTP.
Column ss ss.
Person to person, to person to person.
The
Ansip IPA adding elements as all human for this method IPA Index zero for First Element IP Index, one
for second variable IP Index, two for Third Element and IP Index today for Forced Element.
Now we could define create IP function in order not to prolong the time of the session.
We will finish it and we will continue the content in the next session.
Goodbye.