TPBROADCAST-broadcast notification by name
01TPBCTDEF-REC.
COPY TPBCTDEF.
01TPTYPE-REC.
COPY TPTYPE.
01DATA-REC.
COPY User data.
01TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPBROADCAST" USINGTPBCTDEF-RECTPTYPE-RECDATA-RECTPSTATUS-REC.
TPBROADCAST allows a client or server to send unsolicited messages to registered clients within the system. The target client set consists of those clients matching identifiers passed to TPBROADCAST. Wildcards can be used in specifying identifiers.
LMID, USRNAME and CLTNAME, all in TPBCTDEF-REC, are logical identifiers used to select the target client set. A SPACES value for any logical identifiers constitutes a wildcard for that argument. A wildcard argument matches all client identifiers for that field. Each identifier must meet the size restrictions defined for the system to be considered valid, that is, each identifier must be between 0 and 30 characters in length.
The data portion of the request is identified by DATA-REC and LEN in TPTYPE-REC specifies how much of DATA-REC to send. Note that if DATA-REC is a record of a type that does not require a length to be specified, then LEN is ignored (and may be 0). If REC-TYPE in TPTYPE-REC is SPACES, in which case DATA-REC and LEN are ignored and a request is sent with no data portion.
Following is a list of valid settings in TPBCTDEF-REC.
TPNOBLOCK
TPNOBLOCK or TPBLOCK must be set.
TPBLOCK
TPNOBLOCK or TPBLOCK must be set.
TPNOTIME
TPNOTIME or TPTIME must be set.
TPTIME
TPNOTIME or TPTIME must be set.
TPSIGRSTRT
TPBROADCAST, the message has been delivered to the system for forwarding to the selected clients. TPBROADCAST does not wait for the message to be delivered to each selected client. Either TPNOSIGRSTRT or TPSIGRSTRT must be set.
TPNOSIGRSTRT
TPNOSIGRSTRT or TPSIGRSTRT must be set.
Upon successful completion, TPBROADCAST sets TP-STATUS to [TPOK].
Under the following conditions, TPBROADCAST sends no broadcast messages to application clients and sets TP-STATUS to:
TPEINVAL]
LMID will cause TPBROADCAST to fail and return TPEINVAL. However, non-existent user or client names will simply successfully broadcast to no one.
TPETIME]
TPBLOCK and TPTIME were specified.
TPEBLOCK]
TPNOBLOCK was specified.
TPGOTSIG]
TPSIGRSTRT was not specified.
TPEPROTO]
TPBROADCAST was called in an improper context.
TPESYSTEM]
TPEOS]
The interfaces described in TPNOTIFY() are supported on native site UNIX-based processors. In addition, the routines TPBROADCAST and TPCHKUNSOL() as well as the routine TPSETUNSOL() are supported on UNIX and MS-DOS workstation processors.
Clients that select signal-based notification may not be signal-able by the system due to signal restrictions. When this occurs, the system generates a log message that it is switching notification for the selected client to dip-in and the client is notified then and thereafter via dip-in notification. (See ubbconfig(5) description of the RESOURCES NOTIFY parameter for a detailed discussion of notification methods.)
Note that signaling of clients is always done by the system so that the behavior of notification is consistent regardless of where the originating notification call is made. Because of this, only clients running as the application administrator can use signal-based notification. The id for the application administrator is identified as part of the configuration file for the application.
If signal-based notification is selected for a client, then certain ATMI calls can fail, returning TPGOTSIG due to receipt of an unsolicited message if TPSIGRSTRT is not specified. See ubbconfig(5) and TPINITIALIZE() for more information on notification method selection.
TPINITIALIZE(), TPNOTIFY(), TPTERM(), ubbconfig(5)