Back to home page

Enduro/X

 
 

    


0001 TPEXT_ADDPERIODCB(3)
0002 ====================
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tpext_addperiodcb - XATMI extension, periodic callback function add
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 int tpext_addperiodcb(int 'secs', int (*'p_periodcb')(void));
0016 
0017 Link with '-latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm'
0018 
0019 DESCRIPTION
0020 -----------
0021 This is periodic callback function which is set for Enduro/X servers. Function is called every 'secs' seconds while XATMI server is in state of waiting next service call (during the message poll). The callback function 'p_periodcb' in case of success shall return 0. If callback function returns non 0 value, then XATMI server will proceed with shutdown. The interval is not guaranteed. If the service is doing some work currently then it will not be interrupted. If the service workload was longer than period, then given period will be lost and will be called once timeout exceeded in next sleep period or after receiving next service call.
0022 
0023 If NULL value is passed to 'p_periodcb', then poller is disabled. How ever it is recommend to set 'secs' to 0 too. Or use *tpext_delperiodcb()* for this.
0024 
0025 This function is available only for XATMI servers.
0026 
0027 RETURN VALUE
0028 ------------
0029 On success, *tpext_addperiodcb()* return zero; on error, -1 is returned, with *tperrno* set to indicate the error.
0030 
0031 ERRORS
0032 ------
0033 At current version, function always succeeds.
0034 
0035 EXAMPLE
0036 -------
0037 See *atmitest/test008_extensions/atmisv.c* for sample code.
0038 
0039 BUGS
0040 ----
0041 Report bugs to support@mavimax.com
0042 
0043 SEE ALSO
0044 --------
0045 *tpext_delperiodcb(3)*
0046 
0047 COPYING
0048 -------
0049 (C) Mavimax, Ltd
0050