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 9183109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:43:23+00:00 2026-06-17T18:43:23+00:00

For a download client that I developed in Java using the netty nio lib

  • 0

For a download client that I developed in Java using the netty nio lib I also implemented a bandwith limitation feature. Technically I do so via a GlobalTrafficShapingHandler object. Based on this class’ JavaDoc I initialize the nio client pipeline as follows:

...
trafficHandler = new GlobalTrafficShapingHandler(
        new HashedWheelTimer(), 0, 0, 1000);
execHandler = new ExecutionHandler(
        new OrderedMemoryAwareThreadPoolExecutor(20, 0, 0));
...

public ChannelPipeline getPipeline() throws Exception
{
    // create default pipeline
    ChannelPipeline pipeline = pipeline(); 

    // traffic shaping handler
    pipeline.addLast("global-traffic-shaping", trafficHandler);

    // SSL support
    if(useSSL)
    {
        SSLEngine sslEngine = createSSLEngine();
        pipeline.addLast("ssl", new SslHandler(sslEngine));
    }

    // memory executor
    pipeline.addLast("memory-executor", execHandler);

    // business logic
    pipeline.addLast("data-processing", 
        new NettyNioClientHandler(
            nettyNioClient, localer, logger, ncMgr, username, useSSL));

    return pipeline;
}

And during runtime I then set the max. download speed via

public void setDlSpeedLimit(long limit)
{
    if(limit < 0)
        return;

    trafficHandler.configure(0, limit * 1000L);
}

Ok, so basically the netty nio functionality works fine and fast. When I set the max. download speed in the application, I can also see that the bandwidth usage is indeed capped at a max. level. I monitor the bandwith usage via

trafficHandler.getTrafficCounter().getLastReadThroughput();

However, unfortunately the max. speed I monitor is not to what I have set it before, not even close. For example, I originally (w/o limit) have a download speed of about 2000 kb/s, then I set the limit to 300 kb/s as described above, but the real download speed is then varying from 700-900 kb/s.

So my problem in this case is: I can see that the traffic shaper is doing something, but not as I wanted it to. Do I miss something here, any step in the pipeline initialization for example?

Thanks in advance for your help!

  • 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-06-17T18:43:25+00:00Added an answer on June 17, 2026 at 6:43 pm

    Ok, so it seems there are not other ideas.
    The only thing that helped me a bit was to increase the timing counter to 5-10 sec.

    Cheers!

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

Sidebar

Related Questions

My client want to use Installing apps wirelessly feature. Using this he can download
We have developed an exe and we have created a website to download that
I am creating a fairly simple Java client that connects to my account and
May i achieve that server side application (using android bluetooth API)connect to particular client
I have a WCF client that download content from the server. the service contract
I just saw a really cool WPF twitter client that I think is developed
I'm trying to download and run a file to the client machine. The client
I need the browser to download the appropriate script for the client browser. I
I have rich client platform project. To ramble through source code I have download
I'm using the following headers to push downloads to the client from a generic

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.