Start up the Open Server application.
CS_RETCODE srv_run(ssp)
SRV_SERVER *ssp;
A pointer to the Open Server control structure. This is an optional argument.
Returns |
To indicate |
---|---|
CS_SUCCED |
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. |
#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));
}
srv_run starts, or restarts, the Open Server application.
srv_run returns when the server is stopped by a SRV_STOP event.
Once started, the server listens for a client request, calls the function defined to handle the request, and then continues listening for further requests.
If a server has stopped, it must be re-initialized using srv_init before it is restarted.
If 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.