Installing Event Handlers

This example shows the gateway application installing an SRV_START event. An SRV_START event occurs once (when srv_run is called) and starts the Open Data Services server application. The SRV_START event invokes the init_server callback function defined in GATECBS.C to initialize the remote server. The init_server function installs the remaining events required to run the gateway application.

  1. Add a prototype for the init_server function in the gateway callback program, GATECBS.C:
    int init_server (SRV_SERVER * server);
    
  2. Install an SRV_START event using srv_handle to call the init_server function when an Open Data Services server application is first started:
    srv_handle (server, (DBINT)SRV_START, init_server);
    
  3. Return the srv_continue constant to the Open Data Services server application to continue processing events:
    return (SRV_CONTINUE);