![]() |
![]() |
|
|
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(3cbl), or by an identifier received with a previously processed message, using TPNOTIFY(3cbl). Messages sent via TPBROADCAST can originate either in a service or in another client. Messages sent via TPNOTIFY can originate only in a service.
The TPBROADCAST(3cbl) routine 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 TPINITIALIZE and have not yet made a call to TPTERM.
Use the following signature to call the TPBROADCAST routine.
01 TPBCTDEF-REC.
COPY TPBCTDEF.
01 TPTYPE-REC.
COPY TPTYPE.
01 DATA-REC.
COPY User Data.
01 TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPBROADCAST" USING TPBCTDEF-REC TPTYPE-REC DATA-REC TPSTATUS-REC.
The following table describes the members of the TPBCTDEF-REC data structure.
TPBCTDEF-REC Data Structure Members
Refer to Defining a Service for a description of the TPTYPE-REC record.
The following example illustrates a call to TPBROADCAST for which all clients are targeted. The message to be sent is contained in a STRING record.
Using TPBROADCAST
. . .
**************************************************
* Prepare the record to broadcasted
**************************************************
MOVE "HELLO, WORLD" TO DATA-REC.
MOVE 11 TO LEN.
MOVE "STRING" TO REC-TYPE.
*
SET TPNOBLOCK TO TRUE.
SET TPNOTIME TO TRUE.
SET TPSIGRSTRT TO TRUE.
*
MOVE SPACES TO LMID.
MOVE SPACES TO USRNAME.
MOVE SPACES TO CLTNAME.
CALL "TPBROADCAST" USING TPBCTDEF-REC
TPTYPE-REC
DATA-REC
TPSTATUS-REC.
IF NOT TPOK
error processing
Broadcasting Messages by Identifier
The TPNOTIFY(3cbl) routine 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 routine.
01 TPSVCDEF-REC.
COPY TPSVCDEF.
01 TPTYPE-REC.
COPY TPTYPE.
01 DATA-REC.
COPY User Data.
01 TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPNOTIFY" USING TPSVCDEF-REC TPTYPE-REC DATA-REC TPSTATUS-REC.
Refer to Writing Global Transactions for information on the TPSVCDEF-REC data structure, and Defining a Service for a description of the TPTYPE-REC record.
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|