Thanks for the reply. Let me flush out the design. We use NetView network management system. It receives SNMP traps and automates actions. In this case, when a mainframe connection to one of our clients goes down, it can result in numerous of these traps be generated (between 1 and 5 usually, but sometimes more).

NetView recieves and processes the trap - firing my client program once for each incoming trap. The client program opens a socket, sends the data (logs it) and terminates. The reciever program is always running, catches the incoming event and makes some business decisions on what to do with it (like logging and paging).

The snoop I ran (solaris) indicates that the client program kicked the appropriate number of times, and sent the appropriate number of messages but the receiving program only reflects some of the messages. Here is an example:

(client says he sent these events - might be ugly here)

$MESSAGE = Mon Apr 5 22:34:56 2004|2|WOK|DOWN|
$MESSAGE = Mon Apr 5 22:34:57 2004|2|Q20|DOWN|
$MESSAGE = Mon Apr 5 22:34:57 2004|2|BYS|DOWN|
$MESSAGE = Mon Apr 5 22:34:57 2004|2|BYU|DOWN|
$MESSAGE = Mon Apr 5 22:34:58 2004|2|W7C|DOWN|
$MESSAGE = Mon Apr 5 22:34:58 2004|2|W0I|DOWN|
$MESSAGE = Mon Apr 5 22:34:58 2004|2|BCU|DOWN|
$MESSAGE = Mon Apr 5 22:35:12 2004|2|F4A|DOWN|
$MESSAGE = Mon Apr 5 22:34:58 2004|2|YEG|DOWN|
$MESSAGE = Mon Apr 5 22:34:58 2004|2|BCM|DOWN|
$MESSAGE = Mon Apr 5 22:34:58 2004|2|Y3A|DOWN|
$MESSAGE = Mon Apr 5 22:35:56 2004|3|F4A|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:29 2004|3|Q20|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:31 2004|3|WOK|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:40 2004|3|BYU|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:40 2004|3|YEG|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:40 2004|3|BCM|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:49 2004|3|W0I|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:50 2004|3|W7C|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:50 2004|3|Y3A|ACTIVE|
$MESSAGE = Mon Apr 5 22:36:50 2004|3|BYS|ACTIVE|
$MESSAGE = Mon Apr 5 22:37:09 2004|3|BCU|ACTIVE|


(receiver says he got these messages - but packet trace shows the senders all sent their packets)

MON APR 5 22:34:56 2004 | <node name omitted> | WOK | DOWN | <customer name omitted> NORTH YORK
MON APR 5 22:35:12 2004 | <node name omitted> | F4A | DOWN | <customer name omitted> DORVAL
MON APR 5 22:35:56 2004 | <node name omitted> | F4A | ACTIVE | <customer name omitted> DORVAL
MON APR 5 22:36:29 2004 | <node name omitted> | Q20 | ACTIVE | <customer name omitted> NORTH YORK
MON APR 5 22:36:31 2004 | <node name omitted> | WOK | ACTIVE | <customer name omitted> NORTH YORK
MON APR 5 22:36:40 2004 | <node name omitted> | BYU | ACTIVE | <customer name omitted> NORTH YORK
MON APR 5 22:36:49 2004 | <node name omitted> | W0I | ACTIVE | <customer name omitted> NORTH YORK
MON APR 5 22:37:09 2004 | <node name omitted> | BCU | ACTIVE | <customer name omitted> NORTH YORK

Where my break down (mentally) is: Does the receiver actually have the capability to receive queued requests? Here is my IO:Socket code bit:
do { use IO::Socket; my $sock = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => '7070', Proto => 'tcp', Listen => 20, Reuse => 1, ); die "Could not create socket: $!\n" unless $sock; # $sock->autoflush(1); my $new_sock = $sock->accept(); $sock->autoflush(1); # -------------------------------------------------------------------- +----- # --- Now process the buffer + --- # -------------------------------------------------------------------- +----- while ($BUFFER = <$new_sock>) { do stuff here } else { #print "$ORIGIN Un-Processed Buffer: $BUFFER\n"; print ERR_DATA "$ORIGIN Un-Processed Buffer: $BUFFER\n"; } } close($sock);

I've left a lot of the code out here for brevity.

In reply to Re: Re: Multiple clients to one server by Anonymous Monk
in thread Multiple clients to one server by Anonymous Monk

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.