StopUser
Log application off the FairCom Server.
Short Name
STPUSR()
Type
Server-only function
Declaration
COUNT StopUser()
Description
StopUser() logs an application off a FairCom Server. It causes all the files not yet closed by the application to be closed and frees a slot on the Server for another user. StopUser() is automatically invoked by CloseISAM(). Therefore, StopUser() is only required in Low-Level applications, or in ISAM applications when a program can exit without calling CloseISAM().
Note: A c-tree application is automatically logged on to a FairCom Server whenever InitCTree(), InitISAM(), OpenISAM(), or CreateISAM() is called. There is no separate call for logging-on to the FairCom Server.
Return
StopUser() returns an error if it could not communicate with the FairCom Server. This might happen if the FairCom Server has been shut down or if the communications link has been disturbed.
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
NO_ERROR |
Successful disconnect. |
133 |
ASKY_ERR |
User cannot be found (has it been shut down?). |
162 |
SGON_ERR |
Server communication link has been disturbed. |
410 |
USTP_ERR |
User is not logged on when StopUser() was called. |
See c-tree Error Codes for a complete listing of valid c-tree error values.
Example
pTEXT pfname;
if (OpenISAM(pfname)) {
printf("\nCould not OpenISAM. Error %d. File %d.", isam_err,isam_fil);
StopUser();
exit(2);
}
See also
CloseISAM(), InitCTree(), InitISAM(), OpenISAM(), CreateISAM()