Hi,

This problem applies to any manner of TCP/IP data exchange, and in this case I'm using POE.

So, using POE::Component::Client::TCP, I'm trying to get some 32 bytes of data from a process. It goes like this. I send a command code, the other guy gets it, and then replies with 32 bytes of data. That's all on the localhost interface. So far so good. Ethereal shows what's going on and the 32 bytes of data are indeed replied. But then, the other guy, after sending his 32-byte reply, *immediately* disconnects, resulting in my POE::Component::Client::TCP exiting with:

Client 2 got read error 0 (Normal disconnection)

The ServerInput event never gets the data. So I tried getting the data using ServerError and ServerFlushed but it these also do not get the 32 bytes of data before the component exits. If only I could get the data then I could send it to another session to get it process.

Maybe I just got the whole thing not right... Maybe I should use a server component to try to get the data from this other process ?

How would you handle such a TCP/IP process that, once you query it for data, sends it and immediately disconnects.

Any suggestions appreciated !


In reply to Unexpected TCP/IP disconnect by carcassonne

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.