Re: Contents of Receive Buffer - WeOnlyDo Discussion board

Re: Contents of Receive Buffer (General questions)

by wodDamir, Thursday, August 23, 2007, 21:02 (6301 days ago) @ bmclellan

Hi Barry,

This is the code I tried in WinBatch:
------------------------------------------------
IntControl(73, 2, 0, 0, 0)
objSSH = ObjectCreate( WeOnlyDo.wodSSHCom.1 )
objSSH.HostName = my_hostname
;objSSH.Port = Port <-- This line has no effect
objSSH.Login = my_login
objSSH.Password = my_password
objSSH.Blocking = 1
objSSH.Protocol = 4
objSSH.Timeout = 20

t1 = objSSH.Connect
On Error GoTo :ReceiveResult
t1 = objSSH.WaitFor( [513] ,2)


:ReceiveResult
t1 = objSSH.Receive
objSSH.Disconnect
:EndReceiveResult

:WBErrorHandler
ErrCode = LastError()
ErrText = IntControl(34, ErrCode, 0 , 0, 0)
IntControl(73, 2, 0, 0, 0)
Return
:EndErrorHandler
------------------------------------------------

The result was that the exception was ignored, and t1 had the wanted result stored.

Also, I noticed in your code that you set Protocol after Port Property which isn't right, since Setting Protocol Property automatically overwrites Port with the default Port for the chosen Protocol. In other words, you should always set Port Property after you set Protocol.

Hope I helped.

Regards,
Damba


Complete thread: