473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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.
Nov 13 '05 #1
3 7566

"Terry Sanders" <no****@vertone.co.uk> wrote in message
news:Um*******************@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
Nov 13 '05 #2

"Barry Margolin" <ba************@level3.com> wrote in message
news:KO***********@news.level3.com...
In article <Um*******************@news-binary.blueyonder.co.uk>,
Terry Sanders <no****@vertone.co.uk> wrote:
For various reasons I need to how many packets are queued in the SO_RCVBUFof a udp socket. I know there are various mechanisms for detecting if thereis one
or more packets queued, but I cant find anything to tell me exactly how manyare 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
Nov 13 '05 #3
In comp.protocols.tcp-ip Terry Sanders <no****@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...
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ajay | last post by:
hi! 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...
6
by: Clarence Gardner | last post by:
I've got a problem that I don't see how to program around. A socket server that was running fine, today started getting an exception from the bind() call (errno 22, Invalid argument) and yet the...
0
by: Josh | last post by:
I have written a simple TCP client/server. I would like to change the TCP receive buffer on the server side, to see performance differences. I am trying err =...
2
by: Rene Sørensen | last post by:
We are 4 students working on a assignment, that our teacher gave use, normally we do this is C++, but the 4 of us, use C# more often that C++ so… We made a small games called reversi, now our job...
0
by: obarrientos | last post by:
I found the visual basic code that can be used to set the TCP windows size, http://support.microsoft.com/kb/q237688/ However, how would this be modified to be used in an ASP page? The two...
1
by: Lina | last post by:
Hi all, am doing Client/Server application using Socket class, then i need to analysis the packet to retrieve the header for each packet, i read in some resources that i can do it using...
1
by: Mr. Beck | last post by:
Hello, Please Help..... I have been working with some tcp/ip socket communication within a C# program recently. Basicly, I have a program (myProblemProgram) that has a socket connected to...
2
by: kashifjawed | last post by:
I'm developing a c# asynchronous socket application for tranfering file or large data from client to server and server to client as well in chunks. Application sometimes transfer file from client...
2
Airslash
by: Airslash | last post by:
Hello, I've written my own class for the UDPClient that whats the UdpClient from .NET Using an Interface I define my own functions and map them downwards. The class works, tested with unittests...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.