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

  • Home
  • SEARCH
  • 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 8348981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:51:12+00:00 2026-06-09T07:51:12+00:00

I’m trying to decide how to design a Netty app with what I think

  • 0

I’m trying to decide how to design a Netty app with what I think are some unusual requirements. Basically there’s a client that initiates a request. That request translates into English as “Go recursively get a bunch of little tiny files under directory /whatever/, and all I can tell you about those files is that their names are between AAAAAAA.bin and CCCCCCC.bin”.

So, the server needs to take the request, and start scanning some directories on the server side, and start rapidly streaming all these little files back. Performance is critical, but so is making sure that I’ve received all files between AAAAAAA.bin and CCCCCCC.bin.

So would it be a good design to make the client and server basically asynchronus themselves? In other words, the client initiates the conversation, sends the request, and simply receives an acknowledgement UUID token or something, and then the server begins gathering up files (maybe one per thread), contacts the client, and hands it a single file along with the UUID? I’m thinking that the client could periodically ask the server “are you done streaming my request that matched UUID token /sometoken/?

I’m not quite sure how this would be configured, since the client and server both would be initiating conversations. Or, maybe someone else has a better design idea? Again, performance (total time from request initiation to completion of all file transfers) is critical.

Thanks!

  • 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-09T07:51:13+00:00Added an answer on June 9, 2026 at 7:51 am

    Assuming that you’re in complete control of the protocol (ie you’re not limited to HTTP), then perhaps something like

    1. Client connects to server and sends directory request. If client is restarting an aborted transfer is sends a request with the token from 2
    2. Server responds with a unique token for this transfer. If transfer is being restarted it responds with the token from 1.
    3. Server identifies all files for this transfer, gives each file a unique id, and associates the file set with the token from 2 (might want to figure out the files before generating the token)
    4. For each file the server sends a message consisting of file length, unique file id, file (and any other information, such as filename). The server sends each file ASAP and does not wait for the acknowledgement from 5.
    5. Client acknowledges each file received using unique file id.
    6. After last file sent, server sends a “transfer complete” message.

    All of the above communication happens over a single channel. The important point is that you’re streaming the files and receiving acknowledgements asynchronously thus mitigating network latency.

    If you have a lot of files I wouldn’t use a thread per file. Perhaps a thread pool where each file to send is added to a job queue, or perhaps each unique directory is added to the job queue and a thread processes a directory at a time. You may need to synchronise calls to channel.write(..). I’m also assuming that it’s ok for the client to receive files out of order.

    Actually, I would initially get it going with just one thread to read the files. Once it’s working reliably look to see if having multiple threads enables you to increase performance by keeping the network busy (ie not waiting to read the next file).

    When writing to the channel I’d probably write on object containing the file details (unique id, file data if small enough, filename if necessary) and then have a codec that can convert the object to / from a channel buffer.

    Depending on your exact circumstances the client could open multiple connections to the server and you could assign a connection to a specific file reading thread thus avoiding any channel synchronisation issues. You may get some performance increase that way but, most likely, you’ll just see the available bandwidth shared between the connections.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I know there's a lot of other questions out there that deal with this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.