wodVPN ActiveX Control - Fast notifications interface
 

 

Basic information

As you might have read elsewhere, wodVPNCom can use a fast notification interface instead of firing events. This means that each time wodVPN would normally 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 them if performance is a requirement of your applications.

wodVPN ActiveX DOES NOT support notifications - only the wodVPNCom component does!

You must declare ALL notification methods if you want to implement IwodVPNNotify, no matter whether you need them or not. For example, many users don't need the SocksConnect event, but at least the empty body for this event MUST exist when notifications are used.

You can read below the steps that are required to implement your own IwodVPNNotify interface. As an example, we will put it on the main form. You can also put it into a separate VB class, in which case instead of the 'Me' keyword, you will use name of the class.



Steps needed to implement IwodVPNNotify

1. Add a Reference to the wodVPNCom COM Object to your application

2. Instead of declaring wodVPN like this:

Dim WithEvents VPN1 as wodVPNCom

you should do this:

Dim VPN1 as wodVPNCom
Implements IwodVPNNotify

3. In Form_Load, create new instance for VPN1, and pass reference of our IwodVPNNotify to it

Set VPN1 = new wodVPNCom
Set VPN1.Notification = Me

4. Implement ALL methods, or at least declare their empty bodies. You can do it automatically if you locate the 'IwodVPNNotify' object in the list of all objects that exist on your form (combo box in upper left corner of your code view), or just can do it by hand.

5. All done. Now put breakpoints into your methods. You will see that instead of the event firing, your methods will be called instead.



Method declarations

Private Sub IwodVPNNotify_ChannelStart(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Chan As WODVPNCOMLib.IVPNChannel, Allow As Boolean)

End Sub

Private Sub IwodVPNNotify_ChannelStop(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Chan As WODVPNCOMLib.IVPNChannel, ByVal ErrorCode As Long, ByVal ErrorText As String)

End Sub

Private Sub IwodVPNNotify_Connected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal PeerID As String, ByVal IP As String, ByVal Port As Long)

End Sub

Private Sub IwodVPNNotify_Disconnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal ErrorCode As Long, ByVal ErrorText As String)

End Sub

Private Sub IwodVPNNotify_FindMTUDone(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal MTU As Long, ByVal ErrorCode As Long, ByVal ErrorText As String)

End Sub

Private Sub IwodVPNNotify_IncomingData(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Data As Variant)

End Sub

Private Sub IwodVPNNotify_IncomingText(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Message As String)

End Sub

Private Sub IwodVPNNotify_MediatorConnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal IP As String, ByVal Port As Long, ByVal FromID As String, ByVal ToID As String, Data As String, Allow As Boolean)

End Sub

Private Sub IwodVPNNotify_MediatorDisconnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Index As Long, ByVal FromID As String, ByVal ToID As String)

End Sub

Private Sub IwodVPNNotify_MediatorExchangeData(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal FromID As String, ByVal ToID As String)

End Sub

Private Sub IwodVPNNotify_RelayConnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Relay As WODVPNCOMLib.IVPNRelay, ByVal IP As String, ByVal Port As Long, ByVal ID As String)

End Sub

Private Sub IwodVPNNotify_RelayDisconnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Relay As WODVPNCOMLib.IVPNRelay, ByVal IP As String, ByVal Port As Long, ByVal ID As String)

End Sub

Private Sub IwodVPNNotify_SearchDone(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal IP As String, ByVal Port As Long, ByVal ErrorCode As Long, ByVal ErrorText As String)

End Sub

Private Sub IwodVPNNotify_SocksBind(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Chan As WODVPNCOMLib.IVPNChannel, ByVal User As WODVPNCOMLib.IVPNUser, RemoteAddress As String, RemotePort As Long, ByVal Login As String, ByVal Password As String, Allow As Boolean)

End Sub

Private Sub IwodVPNNotify_SocksConnect(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Chan As WODVPNCOMLib.IVPNChannel, ByVal User As WODVPNCOMLib.IVPNUser, ByVal RemoteAddress As String, ByVal RemotePort As Long, ByVal Login As String, ByVal Password As String, Allow As Boolean)

End Sub

Private Sub IwodVPNNotify_StateChange(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal OldState As WODVPNCOMLib.StatesEnum)

End Sub

Private Sub IwodVPNNotify_TCPConnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal RemoteID As String)

End Sub

Private Sub IwodVPNNotify_TCPDisconnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal RemoteID As String, ByVal ErrorCode As Long, ByVal ErrorText As String)

End Sub

Private Sub IwodVPNNotify_UserConnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Chan As WODVPNCOMLib.IVPNChannel, ByVal User As WODVPNCOMLib.IVPNUser)

End Sub

Private Sub IwodVPNNotify_UserConnecting(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Chan As WODVPNCOMLib.IVPNChannel, ByVal Hostname As String, ByVal Port As Long, Allow As Boolean)

End Sub

Private Sub IwodVPNNotify_UserDisconnected(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal Chan As WODVPNCOMLib.IVPNChannel, ByVal User As WODVPNCOMLib.IVPNUser, ByVal ErrorCode As Long, ByVal ErrorText As String)

End Sub

 

Private Sub IwodVPNNotify_VPNRequest(ByVal Owner As WODVPNCOMLib.IwodVPNCom, ByVal RemoteIP As String, ByVal RemoteMAC As String)

End Sub