Send a status value to a client.
CS_RETCODE srv_sendstatus(spp, value)
SRV_PROC *spp; CS_INT value;
A pointer to an internal thread control structure.
The status of the request. By convention, 0 means the request completed normally.
Returns |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#include <ospublic.h>
/*
** Local prototype.
*/
CS_RETCODE ex_srv_sendstatus PROTOTYPE((
SRV_PROC *spp
));
/*
** EX_SRV_SENDSTATUS
**
** Example routine to send a status value to a client.
**
** Arguments:
** spp A pointer to an internal thread control structure.
**
** Returns:
** CS_SUCCEED if we were able to send the status.
** CS_FAIL if an error was detected.
**
*/
CS_RETCODE ex_srv_sendstatus(spp)
SRV_PROC *spp;
{
CS_RETCODE result;
/*
** Send an OK status.
*/
result = srv_sendstatus(spp, (CS_INT)0);
return (result);
}
srv_sendstatus sends a return status value to the client in response to a client request. When a request is received, the programmer-installed event handler routine is called to service it. Part of the response to a request can be to return a status value.
The status value sent by srv_sendstatus is both optional and application-specific. It is not related to the srv_senddone status parameter.
A status value can be sent after all rows, if any, have been sent to the client with srv_xferdata and before the completion status is sent with srv_senddone. A status value cannot be sent between a call to srv_descfmt and srv_bind, and a call to srv_xferdata.
Only one status value can be sent for each set of results.