User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:api:xatmi:tpforward.3

tpforward

Name

tpforward — forward the service call to another service

Synopsis

#include <atmi.h>

void tpforward (char *svc, char *data, long len, long flags);

Link with -latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm

DESCRIPTION

Send the current request control to another process/service and free up current processing instance for next request. This basically makes original tpcall() chaining in relay race mode. The original caller is unaware that it’s call now will be serviced by another service. The destination service is provided in parameter svc, data buffer is passed in data/len pair. data buffer must be allocated by tpalloc() or can be auto-buffer. Auto-buffer is made free by default when call state is return or forwarded. If the buffer in data is not auto-buffer, then it will be deallocated too.

Normally the auto-buffer shall not be made free by user, as that will cause the corruption at the stage of the tpreturn. But auto-buffer free by user can be suitable in case if doing call state transfer over the non XATMI sub-system, then call context restore in other OS process with tpsrvsetctxdata(3) must be done with TPNOAUTBUF flag specified, and the original service which received request prior doing tpcontinue(3) shall make the auto buffer free tpfree(3). If the TPNOAUTBUF was specified at state restore, then tpforward() command will not try to free the auto buffer.

Note that if with call buffer user internally makes calls which changes the buffer type, then original call buffer is made free and the changed type buffer now is user allocated. Thus to deallocated the buffer either user does free of it, or performs tpreturn/tpforward with it.

If current process was in global transaction, then it will make the target process to join the global transaction too. If invalid service name is specified in svc (service is not advertised in system), then call will be returned the caller with service error (TPESVCERR). flags is reserved for future use.

If process have started a global transaction and performs tpforward() without completing the transaction, transaction is automatically aborted and initiating service caller receives TPESVCERR error.

tpreturn() will make the current service routine go back/pop-up the stack to Enduro/X polling mechanisms for next incoming message.

This function is available only for XATMI servers.

RETURN VALUE

Function is marked as void and it have no return values.

ERRORS

No errors available (but some details might be logged in trace files).

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd