Hello people,

I'm searching for a solution to build a client-server
environment. My idea - or my vision :) - is the following:

I have a master process and 1-n defined slave processes.
The master listens on a single port and divert incoming
requests from clients to the slave processes. Now I don't
know the best way to do this. One of my considered
solutions is to deal a new port on that a slave is running.
Maybe each slave runs on a own port. Or maybe a slave could
inherit the new socket ($ns = $socket->accept()).

Does someone have links or snippets with examples that
containes parts of my idea?

Update: The background of my question is that I develope
a performance monitor and 1000s of servers deliver their
statistics like processor, memory and network workload to
a central data server.

Update: Sorry people for my bad description. :(
I try to describe it in example steps:

1. listener.pl runs on port 43600
2. 10 server.pl processes runs on ports 43601-43610
3. incoming client requests on port 43600 to listener.pl
4. listener.pl answer the next free port from a server.pl
5. the client reconnect to a server.pl to deliver his statistics

I want to use this way to devide the workload.

Thanks,
Jonny

In reply to Threading Client-Server (IO::Socket) by bloonix

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.