473,603 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Testing Bandwidth usage of an application

I have a program that I wrote that connects to a remote server and
recieves data at random intervals. I'd like to measure the bandwidth
usage of this program. What is the best way to do this? Should I write
something into the app that can do this... if so, are there any useful
libraries for this purpose? Or, should I maybe look into using a third
party application... if so, can anyone here recommend a good one?

With much respect,
Marcus

Jul 28 '05 #1
4 2696
Marcus wrote:
I have a program that I wrote that connects to a remote server and
recieves data at random intervals. I'd like to measure the bandwidth
usage of this program. What is the best way to do this? Should I write
something into the app that can do this... if so, are there any useful
libraries for this purpose? Or, should I maybe look into using a third
party application... if so, can anyone here recommend a good one?


Why don't you just count the bytes sent/received over the wire and
divide it on the time spent doing it?

Jul 29 '05 #2
This was exactly my question... how does one "count the bytes"? Is
there a specific library you could point me to?

Jul 29 '05 #3
Marcus sade:
This was exactly my question... how does one "count the bytes"? Is
there a specific library you could point me to?


With std::strlen =)

Sockets are pretty platform-dependent, but if you're using
unix function "read" then consult man-pages for its return value,

otherwise consult os-specific api documentation for similar return values.

Or get aquinted with what data you actually recieve.

Tobias
--
IMPORTANT: The contents of this email and attachments are confidential
and may be subject to legal privilege and/or protected by copyright.
Copying or communicating any part of it to others is prohibited and may
be unlawful.
Jul 29 '05 #4

Marcus wrote:
This was exactly my question... how does one "count the bytes"? Is
there a specific library you could point me to?


recv() returns you read byte count or -1 on error. You recv(), don't
you?

Jul 29 '05 #5

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

Similar topics

6
6048
by: FLEB | last post by:
Is there a way to check my site's bandwidth usage via PHP? I'd like to "gracefully bail" if I start to get near my host's limit. Its running on a shared Linux box, on Apache 1.3.31 and PHP v4.3.3 as a module. Thanks. -- -- Rudy Fleminger -- sp@mmers.and.evil.ones.will.bow-down-to.us (put "Hey!" in the Subject line for priority processing!)
0
1383
by: Martin Raychev | last post by:
Hi everybody, I have a need for a web app that will allow a flash client to download files at a specified speed. I am using Flash for an application of mine which downloads JPG slides to users' web based app. Because I can't control how quickly a file (in this case, a JPG slide) is
9
5942
by: Chibi | last post by:
I'm writing an application that's bandwidth intense. My available bandwidth is 1.5Mbps (cable modem) and I know I can reach around 1.4Mbps, if not more. The application I am writing right now simply connects to a newsgroup and downloads the headers. It doesn't do any more specific programmming after that. However, the app will use, at most, 100kbps bandwidth. I'm hoping that it can run much faster than that and reach somewhere close...
3
1772
by: Raj | last post by:
is it possible using C# dotnet to control the bandwidth usage means the transfer rate of download and upload? Thanks!
1
1588
by: Richard | last post by:
Our client's web app will require (or at least recommend) that users have broadband connection. Other than the myriad of web sites that one can go to test bandwidth, are there any custom controls or sample code that you can point me to for use in asp.net 2.0? I'd rather test from within our web app, not send the user to another web site. I've googled but haven't come up with any solutions yet. Thanks in advance.
0
1075
by: brett | last post by:
My shared hosting service provides statistics on bandwidth usage once/mo. I need to track bytes transferred on a daily basis. Is there something I can do in ASP.NET 2.0 for getting bandwidth info, including non ASP.NET pages (HTML, PHP, etc)? Thanks, Brett
0
1045
by: rn5a | last post by:
In a ASP.NET application, users can upload files from their hard disk to the server. Users can also create new files & directories directly on the server, rename them, delete them, edit the files etc. Whenever a user performs any such action, I did like to find out the bandwidth used in the process. Is it possible to find out the bandwidth usage using ASP.NET?
8
6024
by: FrobinRobin | last post by:
Hi, I intend to use Ajax for a kiosk application, it's primary usage is to retrieve live data from my DB, it's a fairly small amount of data (5 fields, of small data size and limited to 15 rows). When I check my server logs I can see that the kiosk page has used a fair amount of bandwidth this month, this is obviously because a javascript timeout refreshes the data every 10 seconds. What I need to know is how to calculate the...
24
2509
by: David | last post by:
Hi list. What strategies do you use to ensure correctness of new code? Specifically, if you've just written 100 new lines of Python code, then: 1) How do you test the new code? 2) How do you ensure that the code will work correctly in the future? Short version:
0
7996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7928
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8415
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8405
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3951
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.