(After reading some socket articles, I can test it with JAVA, and I want to write a GUI point-to-point chat program.
So after two days, intermittently, there are some small twists and turns, whether writing a program still requires patience.
The GUI interface that has just been written, due to the problem of streaming, and the interface is not very satisfactory, so the two written classes are simply deleted. Writing again, I feel a lot better.
The program is actually a C/S model, which is divided into a server and a client. Now I paste the code and share the creation experience.)