Back to product page

Events property


Reference to event handlers.

Type

VPNEventsStruct structure.

Syntax

  • C++
VPNEventsStruct Events;
The Events() syntax has these parts:
Return valueReturns pointer to internal events structure.

Remarks

To use specific event with devVPN, you must implement your own function that has same declaration as the event, and give a reference to VPNEventsStruct for the function. VPNEventStruct members correspond to events, and default to NULL. Below in code samples is shown how to do it for some events.

This is the declaration of VPNEventsStruct
 
   typedef struct VPNEventsStruct
   {
       void (*StateChange)(CVPN *vpn, States state);
       bool (*PeerConnecting)(CVPN *vpn, CP2P *p2p, char *peerName, char *peerAddrs);
       void (*PeerConnected)(CVPN *vpn, CP2P *p2p, char *address, int port);
       void (*PeerDisconnected)(CVPN *vpn, CP2P *p2p, Errors error);
   } VPNEventsStruct;
 


Code sample

  • C++

Platforms

Windows
Mac OSX
Linux
BSD
iPhone IOS