[Top] [Prev] [Next] [Bottom]

tpsvrinit(3)

tpsvrinit(3)

Name

tpsvrinit(3)-the BEA TUXEDO system server initialization routine

Synopsis

#include <atmi.h> 
int tpsvrinit(int argc, char **argv)

Description

The BEA TUXEDO system server abstraction calls tpsvrinit() during its initialization. This routine is called after the thread of control has become a server but before it handles any service requests; thus, BEA TUXEDO system communication may be performed and transactions may be defined in this routine. However, if tpsvrinit() returns with open connections, asynchronous replies pending or while still in transaction mode, the BEA TUXEDO system will close the connections, ignore replies pending, abort the transaction, and the server will exit gracefully.

If an application does not provide this routine in a server, then the default version provided by the BEA TUXEDO system is called instead. The default tpsvrinit() calls tpopen() and userlog() to announce that the server has successfully started.

Application-specific options can be passed into a server and processed in tpsvrinit() (see servopts(5)). The options are passed through argc and argv. Since getopt(3C) is used in a BEA TUXEDO system server abstraction, optarg, optind and opterr may be used to control option parsing and error detection in tpsvrinit().

If an error occurs in tpsvrinit(), the application can cause the server to exit gracefully (and not take any service requests) by returning -1. The application should not call exit(2) itself.

Return Values

A negative return value will cause the server to exit gracefully.

Usage

If either tpreturn() or tpforward() are used outside of a service routine (e.g., in clients, or in tpsvrinit() or tpsvrdone()), then these routines simply return having no effect.

See Also

getopt(3C), servopts(5), tpopen(3), tpsvrdone(3)



[Top] [Prev] [Next] [Bottom]