Have you seen Net::SSH2 just hangs up without any output
. Why not try commenting out any lines relating to blocking?
I was trying to figure out the confusing blocking problem, and came across this in the perldoc
blocking ( flag )
Enable or disable blocking.
A good number of the methods in Net::SSH2/libssh2 can not work in non-
+blocking mode. Some of them may just forcibly enable blocking during
+its execution. A few may even corrupt the SSH session or crash the pr
The ones that can be safely called are read and, with some caveats, wr
+ite. See "write" in Net::SSH2::Channel.
Don't hesitate to report any bug you found in that area!
It would seem that with the shell() method, you may need blocking(0). I suggest trying both ways. :-)
Maybe the resident expert Salva would explain exactly what blocking() does, so we can sort this
out once and for all.
Here is a plausible explanation: blocking vs non-blocking
The reason is that if you want to do two things at once, say read from
+ some other
network connection, and your SSH session, you have two options:
use blocking APIs, and use two threads or processes so you can do
use non-blocking APIs so the same thread can do both
This latter approach is called Asynchronous I/O. See for example twist
+ed which uses it extensively.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||