Home > Mobile >  Qt using UDP receives data, about 1000 packets of data per second
Qt using UDP receives data, about 1000 packets of data per second

Time:09-27

Qt using UDP receives the data, about 1000 packets of data per second, excuse me what method can guarantee on the receiving end of smaller packet loss rate, is the video stream data, can use across threads, the current at the time of display with occasional caton, are ruled out packet loss problem,

CodePudding user response:

In a window in the process is not recommended to do the UDP data reception, suggest more of a Shared memory, using a console to write data receiving applications, with a change to the next, and then the window procedure in order to read the Shared memory, also do a ready sign on each of the Shared memory, when the window procedure after reading the flag set to false, the console the receiving application write Shared memory is full, the flag set to true, and multiple threads access to a Shared memory overhead is very small,

CodePudding user response:

Reply with sending and receiving process, each sending a package out after waiting for the other party under the receive reply whether success to send a packet of data, so as to preserve stability
Every packet data bring a frame number, every time after receiving the judgment on whether a packet of data packet of data

CodePudding user response:

Your traffic is not big ah, not more than 2 MB/s, you get a queue, a thread to the network data, a thread processing data, maintain good this queue, should be no problem
  •  Tags:  
  • Qt
  • Related