wodSSHcom is causing beep sound in Windows 2000 - WeOnlyDo Discussion board

wodSSHcom is causing beep sound in Windows 2000 (wodWebServer / wodWebServer.NET)

by Jon, Thursday, October 14, 2004, 22:03 (7136 days ago)

Hi,
I've been using the wodSSH for over a year with great success. I just updated and noticed that my computer is making a beep in between calls to the send command. I've found that putting short sleep statements between the send commands seems to reduce the bell sounds, but it still happens sometimes (see code below).

Also, to actually receive the output from the command sent via send, I have to send additional line feeds before I get the ouput. Is there another way to get the output that is more reliable?

Here is some vb6 code that I have that will produce the bell sound in Windows 2000 (notice the additional sends of vblf required to actually get the output)

Visual Basic 6 code:

Public Function Command(ByVal sCommand As String) As String
On Error GoTo EH
START:
CheckState

'oSSH is wodSSHCom

sCommand = replace(sCommand, vbCrLf, vbLf)
sCommand = replace(sCommand, vbCr, vbLf)

log SSH COMMAND on & oSSH.HostName & & sCommand & vbCrLf

Dim sReply As String

oSSH.send sCommand & vbLf ' 2>&1 & vbLf
sReply = oSSH.WaitFor(sPrompt, iTimeOut)

'Sleep 150

oSSH.send vbLf
sReply = sReply & oSSH.WaitFor(sPrompt, iTimeOut)

'Sleep 100

oSSH.send vbLf
sReply = sReply & oSSH.WaitFor(sPrompt, iTimeOut)

log sReply
log COMMAND COMPLETE & vbCrLf

Command = GetLog
Exit Function
EH:
Debug.Assert False

Dim iErrCount As Integer
If iErrCount < 1 Then
RestartConnection
iErrCount = iErrCount + 1
Resume START
Else
Err.Raise Err.Number, clsSSH.Command: & Err.Source, Err.Description
End If

End Function


Complete thread: