_TMSTARTSERVER(3)


Table of Contents

1. NAME
2. SYNOPSIS
3. DESCRIPTION
4. RETURN VALUE
5. ERRORS
6. BUGS
7. EXAMPLE
8. SEE ALSO
9. COPYING

1. NAME

_tmstartserver - Start Enduro/X server process in compatibility mode

2. SYNOPSIS

#include <atmi.h>

int _tmstartserver( int argc, char **argv, struct tmsvrargs_t *tmsvrargs);

Link with -latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm

3. DESCRIPTION

Function is used to start Enduro/X XATMI server process. The startup routine takes standard command line arguments and additions structure tmsvrargs filled with tpsvrinit(3) and tpsvrdone(3) callbacks, it also contains the XA Switch object and array filled with services to be advertised after the user’s tpsvrinit(3) is done. Any services which user have advertised by tpadvertise(3) and which have also exported to tmsvrargs.svctab, will be ignored (i.e. TPEMATCH error will be ignored). The tmsvrargs.svctab table must be terminated with row for which svcnm is set to NULL.

If starting XATMI server in mult-threaded, mode _tmbuilt_with_thread_option extern variable must be set to 1.

The struct tmsvrargs_t structure is following:

struct tmsvrargs_t
{
  struct xa_switch_t * xa_switch;   /**< XA Switch                            */
  struct tmdsptchtbl_t *svctab;     /**< Service dispatch table               */
  long flags;                       /**< Reserved for future use              */
  int (*p_tpsvrinit)(int, char **); /**< Server init function                 */
  void (*p_tpsvrdone)(void);        /**< callback to server done              */
  void * reserved0;                 /**< Reserved for future use              */
  void * reserved1;                 /**< Reserved for future use              */
  void * reserved2;                 /**< Reserved for future use              */
  void * reserved3;                 /**< Reserved for future use              */
  void * reserved4;                 /**< Reserved for future use              */
  int (*p_tpsvrthrinit)(int, char **); /**< thread init func                  */
  void (*p_tpsvrthrdone)(void);        /**< thread done func                  */
};

The struct tmsvrargs_t structure is following:

struct tmdsptchtbl_t
{
    char *svcnm;                    /**< Service name                         */
    char *funcnm;                   /**< Function name                        */
    void (*p_func)(TPSVCINFO *);    /**< Function to run on service invocation*/
    long rfu1;                      /**< Reserved 1                           */
    long rfu2;                      /**< Reserved 2                           */
};

RFU bits should be initialized to 0 or NULL.

4. RETURN VALUE

On success, _tmstartserver() returns 0; on error, -1 is returned, with tperrno set to indicate the error.

5. ERRORS

For error records see NDRX and/or ULOG records.

6. BUGS

Report bugs to support@mavimax.com

7. EXAMPLE

See atmitest/test004_basicevent/atmisv4_1ST.c for sample code.

8. SEE ALSO

ndrx_main(3) ndrx_main_integra(3) tpsvrinit(3) *tpsvrdone(3) tpthrsvrinit(3) tpthrsvdone(3)

9. COPYING

© Mavimax, Ltd