By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,922 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,922 IT Pros & Developers. It's quick & easy.

Testing Bandwidth usage of an application

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.