QT uses WIFI to transmit data on different computers. After searching for data, I realized the use of UDP network communication to realize text transmission and the use of TCP network communication to realize the transmission of pictures and videos. I will put all the codes at the end, the code I have made detailed explanations.
1. The text transmission as shown in the figure below uses UDP network communication to realize the mutual transmission of text, which can be realized only by the IP and port of the other party.
2. The transmission of the picture as shown in the figure below uses TCP network communication, which can realize the transmission of one-sided pictures (server → customer service), of course (customer service → server), just copy the code of the server That's it.
3. The video transmission as shown below is similar to the code of 2