Use WIFI to transfer data on different computers in QT

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.

Send text message

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.

Send picture

3. The video transmission as shown below is similar to the code of 2

Insert picture description here

4. Where to place pictures and videos

Insert picture description here

1. All code addresses, directly click to get

2. Of course, you can also go to my github to get it. I hope to like it and pay attention to it. Newcomers need encouragement. click here

Guess you like

Origin blog.csdn.net/m0_48630293/article/details/114453337