I've been itching to write a multi-node crawler for one of my projects, but
haven't gotten around to it. The idea is to have multiple copies of the same
program to distribute HTTP requests and submit all the data to one location.


Using a ServerSocket may or may not be a good way to do it. If you're using
only one program (with, presumably, some built-in method of aggregating the
data), you certainly could use a ServerSocket. If you've got multiple copies
of application 'A' on multiple machines, and all of those report to a single
instance of application 'B' on one machine, then 'B' would have a
ServerSocket to which every 'A' would connect.

At least for my uses, the latter would probably be a better implementation.
'A' would have only have to request data, parse as necessary, and submit to
'B'. In turn, 'B' would handle any number of requests from multiple 'A'
instances.

The former can pose a bit of a problem, though. Let's say you have three
instances of 'A': A1, A2, and A3. Do you interconnect them (A1->A2, A1->A3,
A2->A3)? If this is the case, then A2's ServerSocket has one connection
(from A1), A3 has two (from A1 and A2), and A1 has none. You'd probably need
an array of TCPSocket subclasses stored in an array that represents all
outgoing connections. The ServerSocket would store all incoming connections.
This would let you know exactly who is connected to your instance of 'A',
though it's getting kind of ugly.

Without knowing more about what you're trying to do, it's hard to say what a
good solution is.


Regards,
-Adam
dingostick.com

On 4/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I am trying to create a program that talks to other copies of the
> same program running on other computers on the network, without the
> use of a server.  Is it a good idea to use a serversocket to hold
> connections with all the computers?  Can a serversocket connect to
> another serversocket?
>
>
> Andrew Keller
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to