Hello Monks, I'm having the following issue with Net::SSH2 on a Fedora 2.6.27.5-117.fc10.i686 box. Note that same code works well on Ubuntu, FreeBSD and CentOS.

I'm able to open a connection and a channel to a device, but when I try to read from a channel, code gets blocked in the following line:

while ( my $line = <$handle> ) {

Where $handle is a Net::SSH2::Channel object. I can read the contents of the channel only if I do the following instead:

my $line;
$handle->read( $line, 657 );

657 is the exact number of bytes available on the channel at that time, if I try to read more, or read in a loop, I get stuck again. Only reading the exact 657 bytes works.

libssh2 is version 1.2.7 and Net::SSH2 version is 0.33. Same version I have working on Ubuntu and FreeBSD.

Any ideas?

Thanks, Paulo

In reply to Net::SSH2 blocked while reading from Channel by psantann

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.