-
-
Basic information
As you might have read elsewhere in this guide, wodTunnelCom can employ a fast
notification interface instead of firing events. This means
that each time wodTunnel needs to fire an event, it will call
your implementation of the event instead. Notifications can
be 30 times faster than events - meaning it is advisable to use
notifications if performance is a priority in your applications.
The wodTunnel ActiveX Control and wodTunnel ActiveX EXE DO NOT support notifications - they are only available in
the wodTunnelCom component (the in-process ActiveX DLL)!
You must declare ALL notification methods if you want to
implement IwodTunnelNotify, no
matter whether you need them or not. For example, many users
don't need the
Hostfingerprint
event, but at least the empty body for this event MUST exist
when notifications are used.
Read the following steps to learn how to implement your own
IwodTunnelNotify interface. As an example, we will put it on
the main form. You can also put it into separate VB class,
in which case, instead of the 'Me' keyword, you will use name of your
class.
The steps needed to implement IwodTunnelNotify
1. Add a Reference to the wodTunnelCom COM Object to your
application.
2. Instead of declaring wodTunnel like this:
Dim WithEvents Tunnel1 as
wodTunnelCom
you should do this:
Dim Tunnel1 as wodTunnelCom
Implements IwodTunnelNotify
3. In Form_Load, create a new instance for Tunnel1 and pass a
reference of our IwodTunnelNotify to it:
Set Tunnel1 = new wodTunnelCom
Set Tunnel1.Notification = Me
4. Implement ALL methods or at least declare their empty
bodies. You can do it automatically if you locate the
'IwodTunnelNotify' object in the list of all objects that
exist on your form (combo box in upper left corner of
your code view) or you can just do it by hand.
5. All done. Now put breakpoints to your methods. You will
see that instead of event being fired, your methods will be
called instead.
Method declarations
Private Sub
IwodTunnelNotify_ChannelStart(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel)
End Sub
Private Sub IwodTunnelNotify_ChannelStop(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel, ByVal ErrorCode As Integer, ByVal
ErrorText As String)
End Sub
Private Sub IwodTunnelNotify_Connected(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom)
End Sub
Private Sub IwodTunnelNotify_CryptoInformation(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Protocol As String, ByVal
RemoteName As String, ByVal SCcipher As String, ByVal CScipher As
String, ByVal Keys As String, Accept As Boolean)
End Sub
Private Sub IwodTunnelNotify_Disconnected(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal ErrorCode As Integer, ByVal
ErrorText As String)
End Sub
Private Sub IwodTunnelNotify_HostFingerprint(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Fingerprint As String,
Accept As Boolean)
End Sub
Private Sub IwodTunnelNotify_LoginChallenge(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Challenge As String,
Response As String)
End Sub
Private Sub IwodTunnelNotify_SocksBind(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel, ByVal User As wodSSHTunnelCOMLib.IUser,
RemoteAddress As String, RemotePort As Long, ByVal Login As String,
ByVal Password As String, Allow As Boolean)
End Sub
Private Sub IwodTunnelNotify_SocksConnect(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel, ByVal User As wodSSHTunnelCOMLib.IUser,
ByVal RemoteAddress As String, ByVal RemotePort As Long, ByVal Login
As String, ByVal Password As String, Allow As Boolean)
End Sub
Private Sub IwodTunnelNotify_StateChange(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal OldState As
wodSSHTunnelCOMLib.StatesEnum)
End Sub
Private Sub IwodTunnelNotify_UserConnected(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel, ByVal User As wodSSHTunnelCOMLib.IUser,
ByVal ErrorCode As Integer, ByVal ErrorText As String)
End Sub
Private Sub IwodTunnelNotify_UserConnecting(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel, ByVal Hostname As String, ByVal Port As
Long, Allow As Boolean)
End Sub
Private Sub IwodTunnelNotify_UserDisconnected(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel, ByVal User As wodSSHTunnelCOMLib.IUser,
ByVal ErrorCode As Integer, ByVal ErrorText As String)
End Sub
Private Sub IwodTunnelNotify_UserStateChange(ByVal Owner As
wodSSHTunnelCOMLib.IwodTunnelCom, ByVal Chan As
wodSSHTunnelCOMLib.IChannel, ByVal User As wodSSHTunnelCOMLib.IUser,
ByVal OldState As wodSSHTunnelCOMLib.StatesEnum)
End Sub
|