Slides Java Networking With Channels Reactive Programming and Virtual Threads Networking Terminology
Slides Java Networking With Channels Reactive Programming and Virtual Threads Networking Terminology
Clients are end-user devices or applications, that request services or resources from
servers.
They initiate communication with the servers, and rely on them, to fulfill specific
requests.
As I mentioned, you can have a client server interaction on the same host.
For example, the MySQL database comes with software we've been using called
MySQL Workbench.
The workbench is the client, and it connects to the MySQL database server on that
local host.
It could also connect remotely to another server if needed as well.
When data arrives at the one physical connection to the network, it gets routed to
the target application through a port.
Each application that needs data from the network is assigned a port.
This includes clients connecting to a server, that's on the same machine.
When data arrives, the port number is used to route the data, for the specific
application that's waiting for it.
A port number is a positive integer between 0 and 65535.
Every host connected to the Internet also has a unique IP address, including yours.
IP stands for Internet Protocol.
This describes the destination, or where the data is supposed to go in the network,
and it does it with an IP address.
IPv4 stands for Internet Protocol Version 4, and IPv6 stands for Internet Protocol
Version 6.
Once upon a time, there were only IPv4 addresses.
IPv4 uses a 32-bit address scheme, that allows for over 4 billion unique addresses.
Now that we've got computers, tablets, game consoles, smart TVs, smartphones,
smart appliances, four billion IP addresses wasn't really enough, and so IPv6 was
born.
IPv6 uses a 128-bit address scheme, which allows for many more IP addresses, than
IPv4 does.
Many Internet Service Providers, provide both IPv4 and IPv6 addresses to their
customers.
This ensures compatibility with older and newer technologies.
For example, new routers support IPv6, but if you're hanging onto an older router, it
may not. Or your ISP may only provide IPv4 addresses. Or you just have it
configured that way. As is the case for me, here.
TCP IP describes both the networking and data transport layers used.
It refers to using the TCP protocol for transferring data, over a network of IP
addresses.
Two applications running on the same host can still use TCP IP to communicate with
each other.
When the client and server are on the same host, usually the IP address, 127.0.0.1,
which is also referred to as the local host, is used to identify the host.
When using the low level networking API, you'll use sockets to establish
connections, send requests, and receive responses.
A socket is one end point of the two-way connection.
The client will have a socket, and the server will also have a socket.
When you have multiple clients connecting to the same server, they'll use the same
port, but each client will have its own socket.
You'll use the Socket class for the client socket, and the ServerSocket class for the
server socket.
Since we're talking about networking, we're going to have to write two applications
to demonstrate how to do networking coding.
One application will be the server, and the other will be the client.