beginner problem (wodSSH / wodSSH.NET)
I'm brand new to wodssh and struggling to get to grips with it. Part of my problem is that I am trying to use the control within a graphical programming language called Agilent Vee. This language supports activeX controls well and its syntax for using controls is very much like standard VB. Often you can cut and paste VB code into Agilent Vee and it runs with only minor modification. Anyway to the problems:
The equivalent VB code that I am trying to run is as follows:
wodSSH1.Disconnect
wodSSH1.Hostname = 192.168.11.32
wodSSH1.Login = NicholasEvans
wodSSH1.Password = rogue
wodSSH1.Timeout = 30
wodSSH1.Blocking = True
wodSSH1.Protocol = SSHAuto
wodSSH1.Connect
wodSSH1.WaitFor ( regex:[$ #>] $ )
wodSSH1.Prompt = regex:[$ #>] $
Debug.Print wodSSH1.Execute( ls -h /cygdrive/c & vbLf)
wodSSH1.Disconnect
If I run this code, wodssh connects to my server and I get a connected event fired with error code 0. Good so far.
However, the program then falls over sometimes immediately, sometimes after a timeout on the WaitFor line with an error code 10054 indicating connection was reset by peer!
Ok. so then if I paste the code into vb and run it, it runs ok (wodssh1 control pasted onto a form) and I get a printout of the directory listing resulting from the execute method in the immediate window.
Also, if I connect to the server via putty then I get no problems with sockets.
So, questions:
1. Any idea why one environment may be giving me a 10054 error message when there is patently no problem with connecting to the server?
2. What data type and shape exactly does the execute method return. For example, when the code works in vb, the debug print does list the directory. However, if I try to set a string variable but replacing the execute line with one starting str_receive = wwodssh1.execute( .... then str_receive does not seem to be set with any data.
3. How should the received event and receive methods work with this example. Currently the received event never gets fired. Also, if I add a line to call wodssh1.receive after the execute line, the code falls over in vb on the receive line with a runtime error 1460.
I am trying to access a cygwin server that gives a Prompt of $ .
Any help would be very much appreciated.
Thanks
Nick