Received Event Firing with no Receive Method (wodSSH / wodSSH.NET)

by CraigGibbings, (3985 days ago)
edited by Jasmine,

Unless I am missing something:
Documentation for Received event says:

“Received event will not be fired again until you do Receive data that is currently held in wodSSH's internal buffers”

This is not what I am seeing.
I am seeing Received Events firing on arrival of each data packet even when no Receive method is used. The ByteCount appear to reflect the total number of bytes waiting.
Tthe simple example below demonstrates:

[code]
Dim WithEvents Ssh As wodSSHCom

Private Sub Form_Load()
Set Ssh = New wodSSHCom
End Sub

Private Sub CmdGo_Click()
With Ssh
Debug.Print "Start " & .Version
.HostName = "*****"
.Login = "*****"
.PassWord = "*****"
.Protocol = SSHAuto
.Connect
End With
End Sub

Private Sub Ssh_Banner(Text As String)
Debug.Print "Ssh_Banner " & Len(Text)
Text = ""
End Sub

Private Sub Ssh_Connected(ByVal ErrorCode As Integer, ByVal ErrorText As String)
Debug.Print "Ssh_Connected " & ErrorCode & " " & ErrorText
End Sub

Private Sub Ssh_Received(ByVal ByteCount As Integer)
' No receive of data
Debug.Print "Ssh_Received " & ByteCount
End Sub
[/code]

Output:
Start 3.0.1.185
Ssh_Banner 286
Ssh_Connected 0
Ssh_Received 58
Ssh_Received 1746
Ssh_Received 1768

locked

Received Event Firing with no Receive Method

by Jasmine, (3985 days ago) @ CraigGibbings

Craig,

interesting, we will check it. But most probably we will update the helpfile, will not make changes in the code. It's possible some current users are depending on wodSSH's behavior as it is now.

Thanks,
Kreso

locked

Received Event Firing with no Receive Method

by Jasmine, (3985 days ago) @ CraigGibbings

Craig,

we have updated the documentation, thanks for pointing this out.

Kreso

locked

Received Event Firing with no Receive Method

by CraigGibbings, (3985 days ago) @ Jasmine

Thanks for your response.

Two things:
Correction to your new documentation.
The Received event may be fired more than once, even when you did not collect data from previous event.

This behaviour also applies to the Notify interface as well as the events interface.

locked

Received Event Firing with no Receive Method

by Jasmine, (3984 days ago) @ CraigGibbings

Thanks! Fixed.

locked

Received Event Firing with no Receive Method

by Traveller, (3984 days ago) @ Jasmine

Hi kreso,
I am wondering if the same behavior may happen in the current versions of other components in which they use SSH protocol and may need fixes! such as:
1- SSH Server Active x Comp.
2- SSH Tunnel Active X Comp.
3- SFTP Active X Component.
Thanks & Regards,
Traveller

locked