As a general principle a well-behaved application will release its resources as soon as it can, which favors your first option. So assuming that the period in "periodically" is greater than a couple of minutes, almost certainly that is the better approach. At the same time this means that your clients will effectively be servers, with long-running processes waiting to service requests from your querying server (which is really a client). So, you'll need them to start when the client (that is, server) machine boots.

Now, I take it that the period of time between queries is fairly dynamic. If however it operates at specifiable windows, or if the very next connection time is known, then you could have a client (using your original terminology) connect based on a schedule. For instance, at client boot the server is contacted, at which point it is instructed as to when next to connect. This really depends on the situation though, so I can't say much more.


In reply to Re: Unusual(?) server by djantzen
in thread Unusual(?) server by Nygeve

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.