This method exists only
in the DLL version of wodVPN.
The Notification property holds a reference to the IwodVPNNotify
interface, which can be implemented by your application. When this
property is set and contains such a reference, wodVPN will call your
method implementations instead of firing events. More information on how
this works can be found on the Fast
Notifications Interface page.
For example, instead of having this in your code (VB example):
- Private Sub VPN1_Connected(ByVal PeerID As
String, ByVal IP As String, ByVal Port As Long)
End Sub
you will have this:
- Private Sub IwodVPNNotify_Connected(ByVal Owner
As WODVPNCOMLib.IwodVPNCom, ByVal PeerID As String, ByVal IP As String,
ByVal Port As Long)
End Sub
Which is more or less the same, except the notification method has
one more argument - Owner, which holds a reference to the wodVPN
instance that called this method.
In VB, to implement IwodVPNNotify interface, you need code like this:
- at the top of the code, in the <general> section, put this:
- Dim VPN1 As wodVPNCom
Implements IwodVPNNotify
- in Form_Load (or where you initialize a new instance of wodVPN) do
this:
- Set VPN1 = New wodTunnelCom
Set VPN1.Notification = Me
VPN1.Timeout = 30
VPN1.Start
'...
You will notice that when we declared wodVPN, we did not use the
WithEvents keyword. It is not needed anymore, because events will not be
fired - the Notification methods we implement will be called instead.