UDP queue size

§ä´M¦Û¤vªº¤@¤ù¤Ñ command.bbs at alexbbs.twbbs.org
Wed Jun 17 05:27:50 EDT 2009


I got a problem about UDP.

How do I get the UDP buffer size?

When the server had some delay in handling incoming UDP, it will lost
some package. I wonder it's because the system buffer size, is there any
ways to find the exactly size of the buffer?

ex:

client.py
----------------
import socket

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for i in xrange(1000):
    s.sendto('xxx', ('192.168.1.135',10000))



server.py: in ip (192.168.1.135)
----------------
import socket
import time
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('',10000))
time.sleep(10)

# here will only recv 255 package, others are lost...
for i in xrange(1000):
    msg, addr = s.recvfrom(500)
    print i


--
※Post by command       from 59-124-255-226.HINET-IP.
老鼠的香香乳酪洞˙電子佈告欄系統˙alexbbs.twbbs.org˙140.113.166.7



More information about the Python-list mailing list