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...