Re: UDP server socket

From: Ajay (abra9823_at_mail.usyd.edu.au)
Date: 10/14/04

  • Next message: Miki Tebeka: "Re: Can't connect to MS Exchange (SMTP) from WinXP"
    Date: Thu, 14 Oct 2004 23:28:37 +1000
    To: python-list@python.org
    
    

    Quoting Peter L Hansen <peter@engcorp.com>:

    > Ajay wrote:
    > > whats the maximum number of datagrams that can queue up on a UDP
    > server
    > > socket? or is that system dependent?
    > > i have some code that iteratively handles datagrams, and while testing
    > it,
    > > i noticed that it responds to at most 3 datagrams (i tried sending 4,
    > 6, 8
    > > and 10 datagrams / second)
    > > is that a system dependent feature or can i change that (i didn't see
    > > anything in the manual)
    >
    > I don't believe (though I'm not an expert in UDP) that you can
    > "queue up" UDP packets at all. At least, there are explicitly
    > NO guarantees as to whether any given packet will even make it
    > through the network, and I doubt any system provides explicit
    > guarantees as to how many UDP packets can be handled if there
    > is a backlog. If you are looking for reliable communications,
    > that's what TCP is for... otherwise you have to handle missed
    > or duplicated packets yourself.
    >
    > -Peter
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >

    i am afraid i have to stick with UDP and reliability is no issue. i used
    the word queue but what i really meant was buffer and what i really want
    to know is how many packets get buffered (the ones that make through).
    i dont believe that when i send 10 packets, 7 get lost and 3 make it
    through. Since when i send 3, i always get all 3 (well except perhaps once
    or twice) but i can never get any more than 3. i want to confirm if this is
    a buffering issue
    in my code i do something like
    while 1:
            data, address = self.UDPserversocket.recvfrom(1024)
            #do a lot of processing which usually takes between 4-8 seconds

    my question is whether the socket buffers incoming packets, what is the
    size of the buffer and is there any way of increasing it.
    If not, a solution may be to carry the processing in another thread, but
    thats going to increase the overhead (the app. is for a PDA).

    ----------------------------------------------------------------
    This message was sent using IMP, the Internet Messaging Program.


  • Next message: Miki Tebeka: "Re: Can't connect to MS Exchange (SMTP) from WinXP"

    Relevant Pages

    • Re: Losing UDP packets with MFC Sockets
      ... CPU load is not the main culprit in UDP ... > the input buffer is being overload and packets are being discarded. ...
      (microsoft.public.vc.mfc)
    • Re: UDP packets
      ... Why did you choose UDP in the first place? ... and client run on the same machine. ... 100000 UDP packets within 2 min. ... Even for the same buffer size, ...
      (comp.unix.programmer)
    • Re: UDP packets
      ... and client run on the same machine. ... 100000 UDP packets within 2 min. ... there's no point in having a send buffer. ...
      (comp.unix.programmer)
    • Re: How full is a UDP socket buffer
      ... > UDP socket and puts them in a buffer in memory (call it the application ... > receiving packets from the UDP socket while T2 is doing I/O? ... > of the incoming packets until T1 gets a chance to recvfrom it. ...
      (comp.unix.programmer)
    • Re: Losing UDP packets with MFC Sockets
      ... CPU load is not the main culprit in UDP packet ... the input buffer is being overload and packets are being discarded. ...
      (microsoft.public.vc.mfc)