Re: Timeout causes script to terminate - WeOnlyDo Discussion board

Re: Timeout causes script to terminate (General questions)

by Logan, Friday, June 27, 2008, 15:48 (5992 days ago) @ woddrazen

Thanks for your reply.

Here is the code where it hangs. I could change the timeout to 0 but I have a feeling the script will never find the text in the wait for. The second line from the bottom is the one where the code is exiting... I am reverse telnetting into a modem on a router and it is proving to be very tricky, as not all of the modems are responding or echoing (dipswitches are not all proper) ... I if I wait for a LF it works a little bit more often, but the way I've got it now waiting for any character A-Z works very well, except those cases where the modem freaks out and doesn't send anything back. Is there a way to make it so the script does not break on all errors, or is there a way to make wodssh dll not exit the script when it hits the timeout? Or if you've got any ideas for my script.

CRLF = Chr(13) & Chr(10)
CR = Chr(13)
LF = Chr(10)

Set ssh = CreateObject( WeOnlyDo.wodSSHCom.1 )
ssh.HostName = routerip
ssh.Login = username
ssh.Password = password
ssh.Blocking = true
ssh.Protocol = 4
ssh.Timeout = 65
ssh.Connect
''... blah blah login and do other stuff ...
ssh.Send atdt & phonenumber & CRLF
wscript.echo dialing & phonenumber
ssh.WaitFor regex:[A-Z]
sSocketText = ssh.Peek + sSocketText
''... blah blah do more stuff ...


Complete thread: