Re: How to catch error (or exit) when Receive hang - WeOnlyDo Discussion board

Re: How to catch error (or exit) when Receive hang (General questions)

by novanstar, Wednesday, November 05, 2008, 00:46 (5864 days ago) @ woddrazen

Hi,


You can try with Execute Method. Something like this:
[code]$ssh->WaitFor('weonlydo@linux:~$');
$ssh->{DataReady} = 0;
print $ssh->Execute( ls -al\n ,'weonlydo@linux:~$');
$ssh->Disconnect();[/code]

Drazen

Hi Drazen,
In my case, I don't have any pattern to match (even command prompt because the command I issue won't return to command prompt). So when I tried per your suggestion, the Execute give me an exception as follows:

======== exception ==========
The current connection has timeout.

Win32::OLE(0.1707) error 0x800a05b4
in METHOD/PROPERTYGET Execute at...
=============================

I am still unable to receive the buffered data from server after the command...

Regards,
novanstar


Complete thread: