Networking Forums

Networking Forums > Computer Networking > Linux Networking > Socket SO_RCVBUF information.

Reply
Thread Tools Display Modes

Socket SO_RCVBUF information.

 
 
Terry Sanders
Guest
Posts: n/a

 
      08-04-2003, 11:23 AM
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.


 
Reply With Quote
 
 
 
 
David Schwartz
Guest
Posts: n/a

 
      08-05-2003, 05:29 AM

"Terry Sanders" <(E-Mail Removed)> wrote in message
news:UmrXa.13665$(E-Mail Removed)...

> 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


 
Reply With Quote
 
Terry Sanders
Guest
Posts: n/a

 
      08-05-2003, 03:20 PM

"Barry Margolin" <(E-Mail Removed)> wrote in message
news:KOuXa.8$(E-Mail Removed)...
> In article <UmrXa.13665$(E-Mail Removed)>,
> Terry Sanders <(E-Mail Removed)> 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


 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      08-05-2003, 06:15 PM
In comp.protocols.tcp-ip Terry Sanders <(E-Mail Removed)> 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...
 
Reply With Quote
 
Terry Sanders
Guest
Posts: n/a

 
      08-06-2003, 09:33 AM
"Rick Jones" <(E-Mail Removed)> wrote in message
news:XuSXa.1469$8%(E-Mail Removed)...
> In comp.protocols.tcp-ip Terry Sanders <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test socket on Master Socket not working Kevin Cowans Broadband 14 11-15-2006 09:17 PM
10038 Socket Operation on non-socket =?Utf-8?B?UkNyYWlnTGF3MUBhb2wuY29t?= Windows Networking 3 12-23-2004 03:01 AM
10038 socket operation on non-socket Bill H. Windows Networking 1 09-27-2004 03:56 AM
10038 Socket Operation on non-socket error Tim G Windows Networking 1 09-26-2004 03:04 PM
WLAN Monitor 10038 Socket operation on non-socket Bill Windows Networking 1 03-01-2004 10:34 PM



1 2 3 4 5 6 7 8 9 10 11