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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:45:41+00:00 2026-06-12T02:45:41+00:00

I am looking for a way to open many connections to websites in java.

  • 0

I am looking for a way to open many connections to websites in java.

My problem is that the server response times are really slow in many occasions. I therefore thought it would be a good idea to look for some java library that can handle opening many connections and that perhaps uses a handler when the connection/response is ready.

Is there something like (this is pseudo code!!)

getWebsiteContent(URL url) { //does not wait for the response
new AsynchronousConnection(url) {

    requestServedHandler(ConnectionObject) {
        InputStream is = ConnectionObject.getInputStream();

        //here I will process the content of the stream only when it is available
    }
} 
}

I would not mind a handler that gives me the raw HTML.

  • 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-12T02:45:42+00:00Added an answer on June 12, 2026 at 2:45 am

    I’m not aware of such a specialized library, but you can create your own multi-threaded solution. Write your retriever task as a Callable that returns the HTML then submit these callables with the appropriate URLs to an ExecutorService. There are loads of code examples for this pattern on the net, but I could write you one if you ask.
    A little more hint: This setup resembles to the quite common producer-consumer pattern. Your tasks could put the site contents into a BlockingQueue and let the processor thread poll in periodically to look for ready data. Either poll with a timeout if you want more liveliness or without, but that would block until data is available.

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

Sidebar

Related Questions

I am looking for a way to open the method popup that shows up
I'm looking for a way to open an Access MDB file inside a Java
My problem is that I was looking for way to use both storyboard and
I am looking for a way to programatically open the New Document dialog in
I'm looking a way to build conditional assignments in bash: In Java it looks
For an open source project I am looking for a way to send multiple
On *NIX systems, is there a way to find out how many open filehandles
I am looking a way to know how many tabs are opened of my
Please note - I am not looking for the right way to open/read a
I'm looking for a tool that can eat as many image formats as possible

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.