Socket SO_RCVBUF information.

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Socket SO_RCVBUF information.

    Hi,

    For various reasons I need to how many packets are queued in the SO_RCVBUF
    of a udp socket. I know there are various mechanisms for detecting if there
    is one
    or more packets queued, but I cant find anything to tell me exactly how many
    are queued.
    Does anybody have any idea how to get this information. I currently need
    this for linux.

    Any ideas would be appreciated.

    Regards

    Terry
    PS. Replace "nobody" in the email address with "trs" to email me.


    Terry Sanders Guest

  2. Similar Questions and Discussions

    1. xml socket
      Hi, I would like to use xml socket in order to make a connection between flash clients but I don't know which would be the best Socket server for...
    2. IO::Socket::SSL
      Hi, Is it also possible to lookup the fingerprints of a peer certificate? Thanks in advanced, Frank de Bot
    3. Socket.accept problem via Socket.for_fd($stdin.fileno)
      Hi, I am experiencing a rather infuriating problem with Socket.accept on Windows XP. The problem exists when I try to create a Socket from...
    4. Socket
      Hi, I would like to know if it is possible to transfer files from one computer to another using socket and Perl(obviously). And which module...
    5. Distinguishing between socket buffer full & socket disconnected
      I am using the IO::Select method can_write() to flow control the writing of a large amount of data to a socket, where the writer may well run ahead...
  3. #2

    Default Re: Socket SO_RCVBUF information.


    "Terry Sanders" <nobody@vertone.co.uk> wrote in message
    news:UmrXa.13665$SQ1.10546@news-binary.blueyonder.co.uk...
    > For various reasons I need to how many packets are queued in the SO_RCVBUF
    > of a udp socket. I know there are various mechanisms for detecting if
    there
    > is one
    > or more packets queued, but I cant find anything to tell me exactly how
    many
    > are queued.
    > Does anybody have any idea how to get this information. I currently need
    > this for linux.
    I don't think anybody will be able to answer your question without
    understanding your actual problem. Just hearing your proposed solution is
    insufficient for us to formulate a solution that will work.

    DS


    David Schwartz Guest

  4. #3

    Default Re: Socket SO_RCVBUF information.


    "Barry Margolin" <barry.margolin@level3.com> wrote in message
    news:KOuXa.8$GI6.5@news.level3.com...
    > In article <UmrXa.13665$SQ1.10546@news-binary.blueyonder.co.uk>,
    > Terry Sanders <nobody@vertone.co.uk> wrote:
    > >For various reasons I need to how many packets are queued in the
    SO_RCVBUF
    > >of a udp socket. I know there are various mechanisms for detecting if
    there
    > >is one
    > >or more packets queued, but I cant find anything to tell me exactly how
    many
    > >are queued.
    > >Does anybody have any idea how to get this information. I currently need
    > >this for linux.
    >
    > You could try using the FIONREAD ioctl, but I don't know if it's
    guaranteed
    > to work or portable. However, if it works it will tell you how many bytes
    > are in the queue, not how many packets.
    >
    > Why do you need to know this, anyway? If another packet arrives after the
    > call returns, the information will be wrong.
    >
    Doesn't FIONREAD return the number of bytes in the next udp packet
    (+ addr len) as opposed to the number of bytes in the RCVBUF?

    What I'm doing is developing an application to test the capabilities
    of another. At any one time it has to decide whether to send the next
    packet, read a packet, act on a packet already read (which may involve
    sending another packet), process timeouts on previous packets sent or
    any one of a number of other things. By knowing how many packets are in
    the read queue the application can make decisions on whether in can
    safely ignore the contents of the read queue, until the next pass, in
    favour of processing other parts which may be running behind.

    Terry Sanders


    Terry Sanders Guest

  5. #4

    Default Re: Socket SO_RCVBUF information.

    In comp.protocols.tcp-ip Terry Sanders <nobody@vertone.co.uk> wrote:
    > Doesn't FIONREAD return the number of bytes in the next udp packet
    > (+ addr len) as opposed to the number of bytes in the RCVBUF?
    On HP-UX at least the manpage for ioctl(5) states:

    FIONREAD
    Returns in the long integer whose address is arg the
    number of characters immediately readable from the
    device file.
    > What I'm doing is developing an application to test the capabilities
    > of another. At any one time it has to decide whether to send the next
    > packet, read a packet, act on a packet already read (which may involve
    > sending another packet), process timeouts on previous packets sent or
    > any one of a number of other things. By knowing how many packets are in
    > the read queue the application can make decisions on whether in can
    > safely ignore the contents of the read queue, until the next pass, in
    > favour of processing other parts which may be running behind.
    Sounds like knowing how full the socket buffer with FIONREAD would be
    sufficient - assuming you know in advance the typical datagram sizes
    so you know whether or not you are within N datagrams of overflowing
    the socket buffer.

    rick jones
    --
    a wide gulf separates "what if" from "if only"
    these opinions are mine, all mine; HP might not want them anyway... :)
    feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
    Rick Jones Guest

  6. #5

    Default Re: Socket SO_RCVBUF information.

    "Rick Jones" <foo@bar.baz.invalid> wrote in message
    news:XuSXa.1469$8%2.658@news.cpqcorp.net...
    > In comp.protocols.tcp-ip Terry Sanders <nobody@vertone.co.uk> wrote:
    > > Doesn't FIONREAD return the number of bytes in the next udp packet
    > > (+ addr len) as opposed to the number of bytes in the RCVBUF?
    >
    > On HP-UX at least the manpage for ioctl(5) states:
    >
    > FIONREAD
    > Returns in the long integer whose address is arg the
    > number of characters immediately readable from the
    > device file.
    >
    You're right about this. I can use this with a high/low mark to
    decide on priorities.

    Cheers

    Terry Sanders


    Terry Sanders Guest

  7. #6

    Default Re: Socket SO_RCVBUF information.

    Quote Originally Posted by Terry Sanders View Post
    Hi,

    For various reasons I need to how many packets are queued in the SO_RCVBUF
    of a udp socket. I know there are various mechanisms for detecting if there
    is one
    or more packets queued, but I cant find anything to tell me exactly how many
    are queued.
    Does anybody have any idea how to get this information. I currently need
    this for linux.

    Any ideas would be appreciated.

    Regards

    Terry
    PS. Replace "nobody" in the email address with "trs" to email me.
    Use netstat -a.
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139