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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:15:37+00:00 2026-06-18T14:15:37+00:00

How could I most efficiently go through a database of 12,000 IP addresses and

  • 0

How could I most efficiently go through a database of 12,000 IP addresses and ping open a socket with them all?
Currently I am working like this:

  • Get all the IPs in the list
  • For every IP, open up a new thread that opens a socket with the server and receives a packet from it.
  • On the new thread, update the information based on weather the IP is online, and what it returns when we open the socket.

My current solution works, it just takes ages to get through the database once. I am trying to find a way to get through the database extremely fast; however, I don’t know where to begin. Any help is appreciated, thanks!

EDIT: I am opening a socket and sending a TCP packet, then storing the information.

  • 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-18T14:15:39+00:00Added an answer on June 18, 2026 at 2:15 pm

    try to use something like netty (NIO) for this. You can just spread out your requests to all the IPs (for whatever reason) in one thread and wait for the returns in one other thread. Your current approach uses threads to manage the asynchronous answers of all the remote hosts, which seems to be ok and will work, but producting threads just to wait is not this optimal. better open lots of connections, sent packets, wait for results and let the OS manage the waiting.

    Use multiple Threads only, if you want to perform concurrent computations which take unpredictable time. If you have such clearly defined tasks, like opening lots of sockets, sending data and waiting for responses, use NIO frameworks in java (btw. normally a single thread should be sufficient here).

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

Sidebar

Related Questions

I have the most basic jquery function of them all, but I couldn't find
I thought that a 32-bit process could use at most 2GB RAM, since half
well i have most probably an extremly stupid problem but could not figure it
I am looking for an algorithm that could find the two most distant elements
Possible Duplicate: Disable copying data from webpage Most content in a webpage could be
The task I have is to (somewhat efficiently) read line-by-line through a very large,
For most database-backed projects I've worked on, there is a need to get startup
I am working my way through some samples, and came up with this working
I'm currently designing a system for processing uploaded files. The files are uploaded through
This seems like an incredibly simple problem however it isn't working out as trivially

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.