OK, further explanation required. In actual fact there are multiple servers running and they have different purposes depending on how they started. Each server is both a server and a client. The idea behind the code is that when a server starts it broadcasts to find other servers on the localnet and locates the servers serving different purposes - some of these could be on the same machine. A server processing type A requests may decide to process it itself or pass it on to a dedicated type A server (hence each server is both a server and a client wrt to the code posted).
All the code is trying to do is locate services on the localnet - the only two-way communication is to broadcast to find servers and receive their primary purpose. So there are multiple "things" that need to listen for the broadcast and respond. After the servers are located TCP/IP commns is used to queue jobs on the relevant servers i.e. the broadcast is only being used to locate services - after that jobs are queued via tcpip to listening servers.
The actual code is not exactly what is posted - it was a cut down version to demonstrate the problem.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|