EventHandler Client

The EventHandler (EH), which was introduced in the getting started guide, maintains a persistent, full duplex bi-directional communication between the server and the connected client.

The EH comprises at minimum two applications, a server application, and a client application. The server EH application can be simultaneously connected to multiple clients. A server EH application that is not connected to any clients is dormant.

A JavaScript EH client is a program designed in the JavaScript scripting language. The JavaScript client, after being loaded from the server, executes in the browser's virtual machine. An EH JavaScript application is what is referred to as a Rich Internet Application. Unlike a traditional web-application, a Rich Internet Application (RIA) typically comprises one page, which is maintained for the life of the application. Refreshing a RIA web page is similar to exiting a Windows program, followed by restarting the Windows program. Refreshing a RIA page restarts the application. The EH connection to the server is lost and re-established when the application restarts. The server EH application sees this as a "disconnect" followed by a "connect".

Loading and starting an EH RIA comprises the following steps:

  1. Using a browser, the user enters the URL to the location for the EH client application. The EH RIA is typically stored as a static HTML file on the server.
  2. The browser loads the EH application.
  3. The application's JavaScript code initializes the RIA client and the EH client stack.
  4. The EH client stack connects to the server EH application. The server EH application, which is implemented in C/C++ code or Lua code, registers the new client.
  5. The EH client application is notified when the connection to the server is established.
  6. The EH RIA resumes normal operation.

Properties of EH client and server applications: