Perhaps there is a buffering issue here? What you're describing isn't quite consistent with that, so if that's the case, something isn't quite as you say it is.

If you want to be doubly certain it's not your client and it's not your network, use something like ngrep to verify the contents of the message. Verify that the entire command is in the message and that it is terminated with a null byte. I cannot imagine that this is not the case.

On the server side, be sure you aren't doing something like while (<$client>) { ... } (without setting $/). Since you're dealing with a binary protocol, it's better in my experience that you use something like sysread to read data, and subsequently chop that data up into discrete commands. You may also have success setting $/ to "\0" and try reading "lines" like above.

If this is a buffering issue, though, I don't know why the server would see \0 but would not see the contents of the command. That just doesn't make any sense to me. With the information you've given us, I don't see how that is possible. Something isn't right.


In reply to Re: Re: Re: more zero byte madness by Fastolfe
in thread more zero byte madness by chorg

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.