Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3229752
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:50:49+00:00 2026-05-17T16:50:49+00:00

I have a class that uses sockets to send and receive data asynchronously over

  • 0

I have a class that uses sockets to send and receive data asynchronously over the network:

class Client
{
    private Socket mSocket;
    /*
    ...
    */
    public void SendPacket(byte[] data)
    {
        mSocket.BeginSend(data, 0, data.Length, SocketFlags.None, OnSent, null);
    }

    private void OnSent(IAsyncResult ar)
    {
        mSocket.EndSend(ar);
    }
}

My question is, how can I calculate the upload rate, while the data is being sent? Does .Net have a way to indicate the download / upload rate over a specific socket?

I am using C# 4.0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:50:50+00:00Added an answer on May 17, 2026 at 4:50 pm

    It is the job of the operating system to provide that kind of info. Fire up Perfmon.exe, select Performance Monitor. Right-click the graph area and click Add Counters. Look in the “Network Interface” section. Bytes sent/sec gives you a good rate indicator. Or Current Bandwidth.

    This is also available from C#, use the PerformanceCounter class. Selecting the right network interface can be a hassle, just keep in mind that the info is available at your fingertips with the performance monitor. The user typically is only interested in how far the download progressed, there very little she can do to make it faster. Simple ProgressBar will do that job just fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that uses 'System.Net.Sockets.Socket' directly for network comunication, and currently I
I have a class that Handles send & receive over a socket between my
I have a class that uses My.Computer.Network.Ping to get a boolean value on whether
I have a client that will send a lots of data to server from
(See this question in ServerFault ) I have a Java client that uses Socket
So I have a class that uses references (&) with functions like void request(tcp::socket&
I have a class that uses filesystem entities to manipulate data. We have several
I have a class that uses XStream and is used as a transfer format
i have a class that uses a proxy class inside to call a service
I have a class that uses org.apache.ant and the class is very simple, it's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.