From: Bryan B. <br...@bu...> - 2007-07-18 14:31:28
|
> On 7/16/07, Bryan Bueter <br...@bu...> wrote: >> I persued Net::SSH2 over a year ago for just this purpose. You can read >> the thread I had with the author here: >> >> http://sourceforge.net/mailarchive/message.php?msg_id=200601192208.43932.dbrobins%40cpan.org >> >> Basically David Robins stated this: >> >> Ah, then there's the problem. Fileno tries to get a real Unix filehandle >> out >> of the object; since it isn't a real Unix file, you won't get one. >> >> I could not get it to work, and David seemed to think that it should not >> work. In that thread there is very simple code that I wrote and even >> that >> doesnt work. > > I think all that would be needed is that Net::SSH2::Channel returns > the fileno of the socket connection. Expect needs a real fileno to do > a select() on it, but everything else is done via the object. > > Ideally, Net::SSH2 should be rewritten as an I/O filter ala > PerlIO::gzip. Well, one may dream... :-) > >> However, all that aside, even without using Expect, Net::SSH2 was not >> thread safe. I sent emails regarding that as well, to no avail. At >> this >> point in time, I really think Expect on top of a spawned ssh command is >> the best way to do things (from a perl perspective). > > I browsed through the source and didn't notice anything obvious that > could hinder thread-usage. Can you remember what it was that was not > thread-safe? > > Yeah, let's stick to ssh for now, nothing wrong with that. But please, > people, remember to not use password-authentication... > > Best regards, Roland > If I remember correctly, when i tried threading with Net::SSH2 in the past (v0.06), it would connect to multiple sessions and then hang when reading from those channels simultaneously. However, now I cant even get the latest version (v0.10) to work in single threaded mode. So for the moment i'm not going to waste any more time on it. Thanks, Bryan Bueter http://sourceforge.net/projects/rover |