I would like for you to explain what this means:

until we uncovered the clients that didn't terminate their last line What?

They closed the socket before sending \r\n?

My code deals with that.

because you're using fixed-length packets, you avoid the actual problem that trapped me
No, not at all.

I thought that I explained clearly how to deal with an indeterminate length \r\n terminated packet.
What was not clear?
Obviously something was not.
It would help if you could ask the question in a different way.

Please look at: sysread. sysread() will return with a number of bytes read.
If the other side sends: "1234\r\n", just look at the end of the buffer to see if there is a line termination (last 2 bytes).
What's the problem?
I think that you can easily adapt my code to deal with your requirements.


In reply to Re^3: Socket descriptor passed across fork -- hanging by Marshall
in thread Socket descriptor passed across fork -- hanging by dd-b

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.