Unfortunately, it appeared that IO::Select mechanics don't play well with this remote system. The most success I've had so far was with POE::Component::Server::TCP. After some discussion with Rocco, the author of POE, I now have a functional setup for the most part. I asked a new question and didn't continue on one of the other questions I had asked because it's not something I was able to find an answer on anywhere else and I didn't want it buried in comments. Because the majority of the script logic is proprietary, I had to redact a lot of it but the basic idea of what I have working now using POE is:

#!/usr/bin/perl # ## *NOTE* this script is ran via terminal # # use strict; use warnings; use POE qw(Component::Server::TCP); # brian d foy's Modulino design pattern __PACKAGE__->poeServer(@ARGV) unless caller sub poeServer { POE::Component::Server::TCP->new( Started => sub { warn "Server started!\n"; }, Port => 8000, ClientConnected => sub { warn "Client connected!\n"; }, ClientDisconnected => sub { warn "Client disconnected!\n"; }, ClientInput => \&client_input, # because peer is SOCK_STREAM ClientFilter => "POE::Filter::Stream", Stopped => sub { warn "Server stopped!\n"; }, ); POE::Kernel->run(); exit; } sub client_input { my ($input) = $[ARG0]; warn "Client sent: $input\n"; my $reply = "00000"; # Acts as ACK to peer confirming data persisted $_[HEAP]{client}->put($reply); } sub ADD { my $handle = IO::Socket::INET->new( PeerHost => "XX.XX.XX.XX", # redacted PeerPort => 8001, Proto => "tcp", Type => SOCK_STREAM, ); my $message = "12345ABCD"; $handle->send($message); my $data; $handle->recv($data, 10); warn "Peer server responded with: $data\n"; $handle->close(); #### Need some way of being notified! }

This code works very well for accepting the messages initiated by the peer without getting hungup waiting on data..just what I wanted on that end!

Also, I am able to initiate a client-side connection to the server on port 8001 (in the example code above, the ADD subroutine). However, once the client-side connection has sent its data and disconnected, what I need is it to somehow notify ADD with the status as it arrives. I'm certainly open to suggestions because at the moment I'm at my wit's end trying to figure out how to notify ADD when the status is sent.


In reply to Re^4: How to share a non-blocking IO::Socket::INET server/pass "listening" control? by ljamison
in thread How to share a non-blocking IO::Socket::INET server/pass "listening" control? by ljamison

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.