Your client is treating the connection as a stream (by using POE::Filter::Stream to interpret the data). It seems to me that the server should be doing the same.

Are your sure your sysread() read everything?

Have you tried printing the length() of what you're sending and receiving? When I do that here, I get:

% perl perlmonks-701147-server.pl
got a connection from 127.0.0.1
sending 21097
and
% perl perlmonks-701147-client.pl
sending request on localhost:12345 ...
input size: 21099
The client receives 2 additional characters: carriage return, and linefeed. The default server-side POE::Filter::Line adds them, and the client-side POE::Filter::Stream doesn't remove them.

If you're still having problems, maybe you're running an old version of POE? I can't reproduce the error with your test case, so something must be outdated or different between our systems.


In reply to Re: sending data over TCP channel using POE::Component::Server::TCP by rcaputo
in thread sending data over TCP channel using POE::Component::Server::TCP by cta

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.