Im really new to Xojo, Ive decided on my first project to connects to a remote server with SSH and run a local script. Then output it to a textarea In the app. Ive installed the MonkeyBreadSoftware SSH class and connected it to the remote server, to run the script. The problem is I only get the first line of the script output. I have a suspension the output is copied to the textarea before it finishes. Does anyone want to save this lost soul?
[code]var Session as SSH2SessionMBS = Window1.session
//* Request a shell */
var channel as SSH2ChannelMBS = session.OpenSession
if channel = nil then
output “Unable to open a session”
Return
end if
channel.SetBlocking false
app.YieldToNextThread
// read greetings
var s as string = channel.Read(10000)
'print s
// start new channel
//* Request a shell */
channel = session.OpenSession
if channel = nil then
output “Unable to open a session”
Return
end if
commandline = “/usr/sbin/iviershowproxys”
channel.Execute commandline
// wait until things are okay
while channel.LastError = -37
call channel.execute commandline
output "Lasterror: "+str(channel.LastError)
session.WaitSocket
wend
do
app.YieldToNextThread
s = channel.Read(10000)
if channel.LastError = session.kErrorEagain then
// no answer yet
Continue
else
s = ReplaceLineEndings(s, EndOfLine)
var lines() as string = split(s, EndOfLine)
Output “”
for each line as string in lines
output line
next
output “”
exit
end if
loop
channel.Close
channel = nil
[/code]