When you do that, first thing you do is you have to create a client object, okay.
So Ethernet Client is the name of this class.
You say EthernetClient client, and that creates a client object.
You need that if you wanna act as a client.
So you create the client object, then you need to connect to a server, right.
If you're a client,
you're gonna wanna connect to a server to get some service from.
So you can do that, we're showing two ways of doing it,
basically you're calling this function called client.connect.
Now client.connect, it takes two arguments.
The first argument, well actually we showed two calls right here.
The first call, its two arguments are IP address and a port.
So you gotta give the IP address and the port number as its two arguments and
then it knows what machine to talk to.
Or you can pass the two arguments of the domain name and the port.
And, remember, using Domain Name Service, DNS,
the domain name can automatically be translated into an IP address.
So either way is fine.
client.connect you can call it, give it an IP address and a port number and
it makes a connection with a server.
Now notice that line of code says result equals client.connect, result equals.
So what that means is that client.connect is gonna return either a zero or a one.
True or false.
It returns a one if a connection is successfully made with a server.
It returns a zero if it's not.
And so then in your code you can say if result then da da da, right.
So you can check to see if a connection was successfully made before you go on and
start communicating.