I'm not a POE expert (I actually discovered it today, thank you :), but I would guess that it's not a POE-related problem.

TCP implementations usually adopt some techniques to send data "packed" together if they can; I'm thinking about optimisation algorithms like Nagle (if I remember well). You don't notice this in telnet, because you probably write your commands and wait for a response - and the initial wait should be sufficient for TCP to decide that it's time to send something. On the other side, your program pumps all the commands together, so if the resources in your machine are enough it will send them all together, while it will probably do something more grateful to you if load is a bit higher.

My quick-and-dirty fix would be putting some delay between requests, or even syncronize them with responses. But the best solution would probably be to make the server more robust and have it accept batches of commands, while doing some caching of a possible truncated command, whose completion could be on its way through the net. Given the fact that I don't know how your server looks like, I cannot say much more!

Flavio

Don't fool yourself.

In reply to Re: POE: how to flush io? by polettix
in thread POE: how to flush io? by johnnywang

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.