How to avoid UDP socket transfers limits? -


I write a program that sends server trough udp socket connection to the client. This program works correctly but If the file is bigger than the transit 8192 KB and prevents the stream and the file I got is corrupt. How can I avoid this limit?

server.py

  host = ... Port = ... file name = ... buf = 2048 ADR = (host, port) UDPSOC = socket (AFINETET, SOCKADARAM) UDPSOC.band (Adr) F = Open (filename, 'WB') block, Eder = UDP During block .recvfrom (buf): if (block == "! END"): # I put "! END" to block the listeners brake. The block (block) block, addr = UDPSock.recvfrom (buf) ) F.close () UDPSock.close ()  

client.py

  host = ... port = ... file name =. .. buf = 2048 addr = (host, port ) UDPSock = Socket (AFINETE, SOCKADARAMM) F = Open (filename, 'RB') Block = F.Drade (Bluff) while blocking: UDP.pd. sendto (block, ADR) block = F.Rad (buff) UDPSOC end ( "! END", addr) f.close () UDPSock.close ()  

You have not yet clarified why you should use UDP - it has not been designed only for high volume data transfers because there is no (common) The crowd is not management.

If you are sending VoIP, when the bus is not transmitted at the right time, then "can not be as fast"?

FWIWs bring specific VoIP system data into 20 MMS segment or nearby packets. So if you are using a voice codec like GSM, then 13 kbps is required, you only have to pack in 260 bits (~ 32 bytes) per pack, and send them every 0.02 seconds.


Comments