PURPOSE

TPBROADCAST - broadcast notification by name

SYNOPSIS


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.

DESCRIPTION

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.

F:Following is a list of valid settings in TPBCTDEF-REC.

TPNOBLOCK

The request is not sent if a blocking condition exists (for example, the internal buffers into which the message is transferred are full). Either TPNOBLOCK or TPBLOCK must be set.
TPBLOCK

If a blocking condition exists, the caller blocks until the condition subsides or a timeout occurs (either transaction or blocking timeout). Either TPNOBLOCK or TPBLOCK must be set.
TPNOTIME

This setting signifies that the caller is willing to block indefinitely and wants to be immune to blocking timeouts. Transaction timeouts may still occur. Either TPNOTIME or TPTIME must be set.
TPTIME

This setting signifies that the caller will receive blocking timeouts if a blocking condition exists and the blocking time is reached. Either TPNOTIME or TPTIME must be set.
TPSIGRSTRT

If a signal interrupts any underlying system calls, then the interrupted system call is reissued. Upon successful return from 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

If a signal interrupts any underlying system calls, then the interrupted system call is not restarted and the call fails. Either TPNOSIGRSTRT or TPSIGRSTRT must be set.

RETURN VALUES

Upon successful completion, TPBROADCAST sets TP-STATUS to [TPOK].

ERRORS

Under the following conditions, TPBROADCAST sends no broadcast messages to application clients and sets TP-STATUS to:

[TPEINVAL]

Invalid arguments were given. Note that use of an illegal LMID will cause TPBROADCAST to fail and return TPEINVAL. However, non-existent user or client names will simply successfully broadcast to no one.
[TPETIME]

A blocking timeout occurred and both TPBLOCK and TPTIME were specified.
[TPEBLOCK]

A blocking condition was found on the call and TPNOBLOCK was specified.
[TPGOTSIG]

A signal was received and TPSIGRSTRT was not specified.
[TPEPROTO]

TPBROADCAST was called in an improper context.
[TPESYSTEM]

A System/T error has occurred. The exact nature of the error is written to a log file.
[TPEOS]

An operating system error has occurred.

PORTABILITY

The interfaces described in TPNOTIFY(3cbl) are supported on native site UNIX-based processors. In addition, the routines TPBROADCAST and TPCHKUNSOL(3cbl) as well as the routine TPSETUNSOL(3cbl) are supported on UNIX and MS-DOS workstation processors.

USAGE

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(3cbl) for more information on notification method selection.

SEE ALSO

TPINITIALIZE(3cbl),
TPNOTIFY(3cbl),
TPTERM(3cbl),
ubbconfig(5)