Back to product page

Fast notifications interface


Basic information

As you might have read elsewhere in this guide, wodXMPPCom can employ a fast notification interface instead of firing events. This means that each time wodXMPP 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 wodXMPP ActiveX Control DOES NOT support notifications - they are only available in the wodXMPPCom component (the in-process ActiveX DLL)!

You must declare ALL notification methods if you want to implement IwodXMPPNotify, 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 IwodXMPPNotify 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 IwodXMPPNotify

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

2. Instead of declaring wodXMPP like this:
 
Dim WithEvents XMPP1 as wodXMPPCom
 

you should do this:
 
Dim XMPP1 as wodXMPPCom
Implements IwodXMPPNotify
 

3. In Form_Load, create a new instance for XMPP1 and pass a reference of our IwodXMPPNotify to it:
 
Set XMPP1 = new wodXMPPCom
Set XMPP1.Notification = Me
 

4. Implement ALL methods or at least declare their empty bodies. You can do it automatically if you locate the 'IwodXMPPNotify' 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 IwodXMPPNotify_ChatRoomInvite(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Room As WODXMPPCOMLib.IXMPPChatRoom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal Reason As String)
 
End Sub
 
Private Sub IwodXMPPNotify_ContactList(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom)
 
End Sub
 
Private Sub IwodXMPPNotify_Connected(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom)
 
End Sub
 
Private Sub IwodXMPPNotify_ContactStatusChange(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal ChatRoom As WODXMPPCOMLib.IXMPPChatRoom, ByVal NewStatus As WODXMPPCOMLib.StatusEnum, ByVal OldStatus As WODXMPPCOMLib.StatusEnum)
 
End Sub
 
Private Sub IwodXMPPNotify_IncomingMessage(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal ChatRoom As WODXMPPCOMLib.IXMPPChatRoom, ByVal Message As WODXMPPCOMLib.IXMPPMessage)
 
End Sub
 
Private Sub IwodXMPPNotify_Disconnected(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub
 
Private Sub IwodXMPPNotify_StateChange(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal OldState As WODXMPPCOMLib.StatesEnum)
 
End Sub
 
Private Sub IwodXMPPNotify_ChatRoomData(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Room As WODXMPPCOMLib.IXMPPChatRoom)
 
End Sub
 
Private Sub IwodXMPPNotify_ChatRoomListDone(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Service As WODXMPPCOMLib.IXMPPService)
 
End Sub
 
Private Sub IwodXMPPNotify_ContactAuthRequest(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, Action As WODXMPPCOMLib.XMPPActionsEnum)
 
End Sub
 
Private Sub IwodXMPPNotify_ContactSearchDone(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Service As WODXMPPCOMLib.IXMPPService, ByVal Items As WODXMPPCOMLib.IXMPPVars)
 
End Sub
 
Private Sub IwodXMPPNotify_Error(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal ChatRoom As WODXMPPCOMLib.IXMPPChatRoom, ByVal Service As WODXMPPCOMLib.IXMPPService, ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub
 
Private Sub IwodXMPPNotify_FileTransferEnd(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal File As WODXMPPCOMLib.IXMPPFile, ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub
 
Private Sub IwodXMPPNotify_FileTransferProgress(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal File As WODXMPPCOMLib.IXMPPFile, ByVal Position As Long)
 
End Sub
 
Private Sub IwodXMPPNotify_FileTransferStart(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal File As WODXMPPCOMLib.IXMPPFile, Action As WODXMPPCOMLib.XMPPActionsEnum)
 
End Sub
 
Private Sub IwodXMPPNotify_HostCertificate(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Cert As WODXMPPCOMLib.ICertificate, ByVal ErrorCode As Long, ByVal ErrorText As String, Action As WODXMPPCOMLib.XMPPActionsEnum)
 
End Sub
 
Private Sub IwodXMPPNotify_IncomingNotification(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal NotifyID As WODXMPPCOMLib.ContactNotifyEnum, ByVal Data As Variant)
 
End Sub
 
Private Sub IwodXMPPNotify_Pong(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub
 
Private Sub IwodXMPPNotify_PreTranslateCommand(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, Command As String)
 
End Sub
 
Private Sub IwodXMPPNotify_PreTranslateReply(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, Reply As String)
 
End Sub
 
Private Sub IwodXMPPNotify_PrivateData(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Name As String, ByVal Value As String)
 
End Sub
 
Private Sub IwodXMPPNotify_ServiceRegister(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Service As WODXMPPCOMLib.IXMPPService, ByVal success As Boolean, ByVal Instructions As String)
 
End Sub
 
Private Sub IwodXMPPNotify_ServiceStatusChange(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Service As WODXMPPCOMLib.IXMPPService)
 
End Sub
 
Private Sub IwodXMPPNotify_UnhandledIQ(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal JID As String, ByVal IqType As WODXMPPCOMLib.IqTypes, ByVal ID As String, ByVal Tags As WODXMPPCOMLib.IXMPPTag)
 
End Sub
 
Private Sub IwodXMPPNotify_VCardDetails(ByVal Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As WODXMPPCOMLib.IXMPPContact, ByVal Partial As Boolean)
 
End Sub
 


Platforms

Windows