Fixed it! With some help from a nice guy on another forum, but this was the solution: The recv call was getting stuck in a loop when the telnet session died unexpectedly - this might be a perl bug. The solution involved IO::Select, which works like a champ:
# this is the fork's parent, the master's child if ($kidpid) { set_state("$rs_info <-- $lc_info"); my $buf = ""; select($remote_server); $| = 1; my $s=IO::Select->new(); $s->add($local_client); while (my @ready=$s->can_read()) { my $r=recv($local_client,$buf,1,0); warn "local recv - $!" unless(defined($r)); last unless(length($buf)); print $buf; }; print STDOUT "Child Exiting: $lc_info --> $rs_info\n" if $de +bug; log_info(0,$user,$lc_info,$rs_info); # Log disconnect kill('TERM', $kidpid); # kill my twin cause we're done } # this is the fork's child, the master's grandchild else { set_state("$rs_info --> $lc_info"); my $buf = ""; select($local_client); $| = 1; my $s=IO::Select->new(); $s->add($remote_server); while (my @ready=$s->can_read()) { my $r=recv($remote_server,$buf,1,0); warn "remote recv - $!" unless(defined($r)); last unless(length($buf)); print $buf; }; print STDOUT "Grandchild Exiting: $lc_info <-- $rs_info\n" i +f $debug; kill('TERM', getppid()); # kill my twin cause we're done }
Thanks everyone, for your help on this.
"Non sequitur. Your facts are un-coordinated." - Nomad

In reply to Re: Re: Re: Re: Help with socket connections by Clownburner
in thread Help with socket connections by Clownburner

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.