Read buffer out of waitfor? (General questions)
Is it possible to read the buffer out of waitfor? I see in the docs that waitfor disables receive. Thank you.
by Logan, (6275 days ago)
Is it possible to read the buffer out of waitfor? I see in the docs that waitfor disables receive. Thank you.
by wodDamir , (6275 days ago) @ Logan
Logan,
I don't see anything like that in help file. WaitFor does remove buffer contents if pattern is received, but not if it times out, in which case buffer remains intact.
In that case, you need to ignore the exception and invoke Receive.
Something like this:
[code]ssh1.HostName = xxxx
ssh1.Login = xxxx
ssh1.Password = xxxx
ssh1.Protocol = SSHAuto
ssh1.Blocking = True
ssh1.Connect
On Error Resume Next
Debug.Print ssh1.WaitFor( joe@debian , 5) 'this is an incorrect prompt pattern to simulate the error
MsgBox ssh1.Receive[/code]
Hope this helps.
Regards,
Damba
by Logan, (6275 days ago) @ wodDamir
I'm writing an ASP page and I need to Peek or Recieve but not until a successful WaitFor. Unfortunately WaitFor disables receive as it is collecting the data from the server. I want to response.write the data waitfor is receiving before it finds te string it is waiting for. I have tried various methods including the do while loop in the sample ASP code, but it doesn't work. Any ideas?
by woddrazen , (6275 days ago) @ Logan
Logan,
You need to receive data just after you connect to server or when you are connected and execute some command?
Drazen
by Logan, (6274 days ago) @ woddrazen
I solved this problem with this little bit of code thanks to your help Drazen, you are the best!
ssh.send command & LF
response.write command sent, please wait...<br>
response.flush
do until cmdend = 1
ssh.DataReady = 0
sshoutput = ssh.receive
sshoutput = replace(sshoutput,LF, <br> )
response.write sshoutput
response.flush
if instr(sshoutput, # ) <> 0 then
cmdend = 1
response.write <p>complete...<br>
End if
Loop
Brilliant, even works on the mobile phone...
...with WOD's excellent support I was able to bypass Winsock and focus on the task at hand...
We have recently completed a large 1200+ location project where reliable Telnet and SSH connectivity was required. wodSSH worked flawlessly and allowed our staff to complete our project ontime and within budget.
...I'm extremely impressed with the product, it represents excellent value for money...
Don't be fooled by the cost, it's value and quality far exceeds the price being charged!
The wodCrypt product is great and we appreciate your effort to add support for UNIX Crypt.
...wodFtpDlx was exactly what I needed, it worked, and it was priced right...
Count us as a satisfied WeOnlyDo customer. We appreciate your terrific support to get the secure Telnet working properly.
WeOnlyDo!COM will be the first stop I make should I require any further off-the-shelf components.
Many thanks for your excellent support service. I can see why you have a long list of excellent testimonials on your website.