C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Testing Bandwidth usage of an application

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Marcus
Guest





PostPosted: Thu Jul 28, 2005 6:14 pm    Post subject: Testing Bandwidth usage of an application Reply with quote



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

Back to top
Maxim Yegorushkin
Guest





PostPosted: Fri Jul 29, 2005 7:41 am    Post subject: Re: Testing Bandwidth usage of an application Reply with quote



Marcus wrote:
Quote:
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?


Back to top
Marcus
Guest





PostPosted: Fri Jul 29, 2005 4:59 pm    Post subject: Re: Testing Bandwidth usage of an application Reply with quote



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

Back to top
Tobias Blomkvist
Guest





PostPosted: Fri Jul 29, 2005 5:33 pm    Post subject: Re: Testing Bandwidth usage of an application Reply with quote

Marcus sade:
Quote:
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.

Back to top
Maxim Yegorushkin
Guest





PostPosted: Fri Jul 29, 2005 5:56 pm    Post subject: Re: Testing Bandwidth usage of an application Reply with quote


Marcus wrote:
Quote:
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?


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.