Network programming:
TCP protocol:
Before using the TCP protocol, a TCP connection must be established to form a transport data channel
It is reliable to use the "three-time handshake" method before transmission.
Two application processes for communication with the TCP protocol: client, server
Large amount of data transfer in connection
The transmission is complete, the established connection needs to be released, the efficiency is low
UDP protocol:
Encapsulates data, sources, and purposes into packets without establishing a connection
Limit the size of each datagram within 64K
It is unreliable due to the need for no connection
No need to release resources at the end of sending data, fast
Socket
Using sockets to develop Web applications has long been widely adopted as a de facto standard.
Sockets are needed on both ends of the communication and are the endpoints of communication between the two machines.
Network communication is actually the communication between sockets.
The socket allows the program to treat the network connection as a stream, and the data is transmitted via IO between two sockets.
An application that typically initiates communication is a client that waits for a communication request
As a service-side
URL programming
URL (Uniform Resource Locator): A Uniform Resource locator that represents the address of a resource on the Internet.
Through the URL we can access various network resources on the Internet, such as the most common www,ftp site. The browser can find the appropriate file or other resource on the network by parsing the given URL.
Java Basics-Network programming