UDP queue size

Discussion in 'Python' started by §ä´M¦Û¤vªº¤@¤ù¤Ñ, Jun 17, 2009.

  1. 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.
    ¦Ñ¹«ªº­»­»¨Å¹T¬}£»¹q¤l§G§iÄæ¨t²Î£»alexbbs.twbbs.org£»140.113.166.7
     
    §ä´M¦Û¤vªº¤@¤ù¤Ñ, Jun 17, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul L. Du Bois

    Queue.Queue-like class without the busy-wait

    Paul L. Du Bois, Mar 24, 2005, in forum: Python
    Replies:
    29
    Views:
    1,079
    Antoon Pardon
    Apr 4, 2005
  2. Russell Warren

    Is Queue.Queue.queue.clear() thread-safe?

    Russell Warren, Jun 22, 2006, in forum: Python
    Replies:
    4
    Views:
    702
    Russell Warren
    Jun 27, 2006
  3. Kceiw
    Replies:
    3
    Views:
    1,017
    Jim Langston
    Mar 14, 2006
  4. Gabriel Rossetti
    Replies:
    3
    Views:
    577
    Jerry Hill
    Apr 25, 2008
  5. Kris
    Replies:
    0
    Views:
    504
Loading...

Share This Page