![]() |
![]() |
|
|
Sending Unsolicited Messages
The BEA Tuxedo system allows unsolicited messages to be sent to client processes without disturbing the processing of request/response calls or conversational communications.
Unsolicited messages can be sent to client processes by name, using tpbroadcast(3c), or by an identifier received with a previously processed message, using tpnotify(3c). Messages sent via tpbroadcast() can originate either in a service or in another client. Messages sent via tpnotify() can originate only in a service.
Broadcasting Messages by Name
The tpbroadcast(3c) function allows a message to be sent to registered clients of the application. It can be called by a service or another client. Registered clients are those that have successfully made a call to tpinit() and have not yet made a call to tpterm().
Use the following signature to call the tpbroadcast() function:
int
tpbroadcast(char *lmid, char *usrname, char *cltname, char *data, long len, long flags)
The following table describes the arguments to the tpbroadcast() function.
tpbroadcast( ) Function Arguments
The following example illustrates a call to tpbroadcast() for which all clients are targeted. The message to be sent is contained in a STRING buffer. Using tpbroadcast( ) Broadcasting Messages by Identifier The tpnotify(3c) function is used to broadcast a message using an identifier received with a previously processed message. It can be called only from a service. Use the following signature to call the tpnotify() function: The following table describes the arguments to the tpnotify() function. tpnotify( ) Function Arguments
char *strbuf;
if ((strbuf = tpalloc("STRING", NULL, 0)) == NULL) {
error routine
}
(void) strcpy(strbuf, "hello, world");
if (tpbroadcast(NULL, NULL, NULL, strbuf, 0, TPSIGRSTRT) == -1)
error routineint
tpnotify(CLIENTID *clientid, char *data, long len, long flags)
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|