Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Components issue events in order to inform other components that something has happenedsignal events for actions within their domain that may be of interest to other components. For instance a WWW proxy might issue an event when the user makes a request or a response is received. A virus scanner might signal an event when some malware has been detected. Other components can register themselves as event sinks and be notified when a specific event has occurred. Some typical events that can occur in WinGate include

  • When a web browser connects to a WinGate proxy service
  • When the Kaspersky AV scanner detects a virus
  • When a WinGate SMTP service receives an email
  • When client software connects via NAT
  • When WinGate starts up or shuts down

 

The general object structure for event sources those events have occurred. 

Setting up an event source

Event generators are called event sources and their general object structure is as follows:

Gliffy Diagram
nameEventOverview

 

Setting up an event source

Adding event source support to your component requires:

  1. Registering a class (template) for your event source with EventRegisterSourceClass. This class describes the events and parameters to those events that instantiations of the event source will contain. You can then instantiate an event source based on this template without having to respecify all of the events and parameters again. For example: The WWW Proxy Service in WinGate registers a source class that describes the events a WWW proxy service can create. Because you can have multiple proxy services, each with the exact same events and event parameter types, all that is needed is to register the event source class once, and then instantiate a new event source from this class when the user creates a new WWW Proxy Service.
  2. Add events to the class with EventRegisterEvent
  3. Add datum (parameters) to the events of the class with EventRegisterEventDatum
  4. Optionally place the event into a realm with EventAssociateRealm
  5. Instantiate the source with EventRegisterEventSource

...