srv_run

Description

Start up the Open Server application.

Syntax

CS_RETCODE srv_run(ssp)
SRV_SERVER     *ssp;

Parameters

ssp

A pointer to the Open Server control structure. This is an optional argument.

Returns

Table 3-112:  Return values (srv_run)

Returns

To indicate

CS_SUCCEED

The server is stopped.

CS_FAIL

Open Server could not start the server.

If srv_run returns CS_FAIL, an application must call srv_init before calling srv_run again.

Examples

Example 1

#include     <ospublic.h>

/*
** Local Prototype.
*/
CS_RETCODE       ex_srv_run PROTOTYPE((CS_VOID));

/*
** EX_SRV_RUN
**   An example routine to start up an Open Server using srv_run.
**
** Arguments:
**   None.
**
** Returns:
**    SRV_STOP    If the server is stopped.  
**    CS_FAIL     If the server can’t be brought up.
*/
CS_RETCODE ex_srv_run()
{
      return(srv_run((SRV_SERVER *)NULL));
}

Usage

NoteIf srv_run is called in the entry functions of a DLL, a deadlock may arise. srv_run creates operating system threads and tries to synchronize them using system utilities. This synchronization conflicts with the operating system’s serialization process.

See also

srv_init, srv_props, “Events”