Default and custom handlers

Open Server has a default event handler routine for each standard event, and one for programmer-defined events. The default handlers are placeholders for the custom event handlers that the application programmer installs with the srv_handle routine. For an application that does not use the default handlers, you must define and install each custom event-handling routine. For more information on installing handlers, see srv_handle.

Event handlers can be installed dynamically. The new event handler is called the next time the event is raised. Event handlers should always return CS_SUCCEED when successful, and CS_FAIL when they fail. Currently, the SRV_START handler is the only event handler whose return code Open Server checks. Returning CS_FAIL from a SRV_START handler causes srv_run to return CS_FAIL to the application without starting Open Server.