The International Organization for Standardization defines the network as the OSI model, dividing the network into seven tiers, from top to bottom: Physical layer, Data link layer, network
layer, Transport layer, Session layer, presentation layer, application layer. Because the model looks huge and bloated, the program staff redefined a
TCP/IP model. It divides the network into four layers, from bottom to top: network interface layer, network interconnect layer, Transport layer, application layer. To be in
On the network to find a program on another computer to communicate, you need to provide the IP address and port number, inetaddress represents the IP address.
Java Network Programming-related classes and interfaces are located in the java.net package. Where the sockets and ServerSocket classes are used in two Java threads
A TCP/IP connection is created between the programs, and the communication between them is performed through the IO class. Datagramscoket class for sending and receiving data
The Datagrampacket class is used to represent the data in the package. The URL class is used to connect to the URL and read data from the URL, urlconnection
Class is used to read and write URL references to resources. The Urlencoder class and the Urldecoder class are useful tools for HTML format encoding and decoding.
Java Network programming