Received Event Firing with no Receive Method - WeOnlyDo Discussion board

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

by CraigGibbings, Wednesday, June 04, 2014, 10:34 (3825 days ago)
edited by wodSupport, Wednesday, June 04, 2014, 10:58

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:


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

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

Received Event Firing with no Receive Method

by wodSupport, Wednesday, June 04, 2014, 10:59 (3825 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

Received Event Firing with no Receive Method

by wodSupport, Wednesday, June 04, 2014, 18:14 (3825 days ago) @ CraigGibbings

Craig,

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

Kreso

Received Event Firing with no Receive Method

by CraigGibbings, Thursday, June 05, 2014, 01:23 (3825 days ago) @ wodSupport

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.

Received Event Firing with no Receive Method

by wodSupport, Thursday, June 05, 2014, 22:01 (3824 days ago) @ CraigGibbings

Thanks! Fixed.

Received Event Firing with no Receive Method

by Traveller, Friday, June 06, 2014, 03:36 (3824 days ago) @ wodSupport

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