tpsetunsol
-routine for setting the method of handling unsolicited messages
#include <atmi.h>
void (*tpsetunsol (void (_TMDLLENTRY *)(*disp) (char *data, long len, long flags))) \
(char *data, long len, long flags)
tpsetunsol
() allows a client to identify the routine that should be invoked when an unsolicited message is received by the BEA TUXEDO system libraries. Before the first call to tpsetunsol
(), any unsolicited messages received by the BEA TUXEDO system libraries on behalf of the client are logged and ignored. A call to tpsetunsol
() with a NULL function pointer has the same effect. The method used by the system for notification and detection is determined by the application default, which can be overridden on a per-client basis (see tpinit
(3)).
The function pointer passed on the call to tpsetunsol
() must conform to the parameter definition given. data
points to the typed buffer received and len
is the length of the data. flags
are currently unused. data
can be NULL if no data accompanied the notification. data
may be of a buffer type/subtype that is not known by the client, in which case the message data is unintelligible.
data
can not be freed by application code. However, the system frees it and invalidates the data area following return.
Processing within the application unsolicited message handling routine is restricted to the following BEA TUXEDO system calls: tpalloc
(3), tpgetlev
(3), tprealloc
(3) tptypes
(3), tpfree
(3).
Upon success, tpsetunsol
() returns the previous setting for the unsolicited message handling routine (NULL is a successful return indicating that no message handling function had been set previously); otherwise, it returns TPUNSOLERR
and sets tperrno
to indicate the error condition.
Under the following conditions, tpsetunsol
() fails and sets tperrno
to:
TPEPROTO
]
tpsetunsol
() was called in an improper context (e.g., from within a server).
TPESYSTEM
]
TPEOS
]
The interfaces described in tpnotify
(3) are supported on native site UNIX-based and Windows NT processors. In addition, the routines tpbroadcast
() and tpchkunsol
() as well as the function tpsetunsol
() are supported on UNIX and MS-DOS workstation processors.
tpinit
(3), tpterm
(3)