§
§ä´M¦Û¤vªº¤@¤ù¤Ñ
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
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