Back to product page

Notification property


Fast notification interface to use instead of events.

Syntax

  • Basic
[Set] object.Notification [= IwodSSHDNotify]    
The Notification(object,IwodSSHDNotify) syntax has these parts:
objectAn expression evaluating to an object of type wodSSHDCom.
IwodSSHDNotifyAn IwodSSHDNotify object.

Remarks

This method exists only in COM version of wodSSHServer.

Notification property holds reference to IwodSSHDNotify interface that can be implemented by your application. When this property is set, and contains such a reference, wodSSHD will call your method implementations instead of firing events. More information on how this works can be found here.

For example, instead of having this in your code (VB example):
 
Private Sub wodSSHD1_LoginPassword(ByVal User As wodSSHDComLIB.ISSHUser, ByVal Login As String, ByVal Password As String, Action As wodSSHDComLIB.SSHActions)
        ' allow everyone to come in and show that big message
        If Login <> "" Then Action = Allow
End Sub
 

you will have this:
 
Private Sub IwodSSHD-Notifications_LoginPassword(ByVal Owner As wodSSHDComLIB.IwodSSHDCom, ByVal User As wodSSHDComLIB.ISSHUser, ByVal Login As String, ByVal Password As String, Action As wodSSHDComLIB.SSHActions)
        ' allow everyone to come in and show that big message
        If Login <> "" Then Action = Allow
End Sub
 

pretty much the same - except notification method has one more argument - Owner, which holds reference to wodSSHD instance that called this method. In VB, to implement IwodSSHD-Notifications interface, you need code like this: - at the top of the code, in section, put this:
 
Dim Sshd As wodSSHDCom
Implements IwodSSHD-Notifications
 

- in Form_Load (or where you initialize new instance of wodSSH) do this:
 
Set Sshd = New wodSSHDCom
Set Sshd.Notification = Me
Sshd.Start
...
 

You can notice that when we declared Ssh, we did not use WithEvents keyword - it is not needed anymore, because events will not be fired anymore. Notification methods we implement will be called instead!

Platforms

Windows