943,634 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 596
  • C RSS
May 3rd, 2008
0

Query multiple servers quickly

Expand Post »
Hello,

I am trying to determine the best possible solution to accomplish a simple, yet complex task. (Regarding: Socket Programming)

I've been working on a new project for quite some time and have written a custom framework from the ground up. It's more or less a (Client --> Server --> Server <-- Client) system.

So far I have the basics done. Here's the process:
  1. I expect to have one client connect to my listening server.
  2. That client will periodically send me a string of IP Addresses (10 or more at a time).
  3. When I receive the data, I split it up accordingly and query the IPs just received.

All of that I can handle and have completed the code for up to 95%. The string of IP Addresses I expect to receive are of other servers in which I will attempt to query and gather data from.

However, the problem is I may need to query up to 100 or 1000 servers and I don't want to have to wait for one to finish, in case it's unresponsive and gets delayed the full timeout length before moving on.

With that said, I want to query as many servers as fast as possible. And I don't care which order they come back in. As soon as I receive the data I just need to save it to a file (no further communication to the original client is required).

I am writing this in C and in the Linux environment -- so is there a way to even do that? Would I need to use the fork() command or write my own custom Socket Pool to handle multiple outgoing connections at once?


- Stack Overflow
Similar Threads
Reputation Points: 26
Solved Threads: 4
Junior Poster
Stack Overflow is offline Offline
185 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: NFA Program in C
Next Thread in C Forum Timeline: Return last token in a string





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC