Queues text message to be broadcast to one or more client connections.
rp_msg [pool_name], [srv_name], [spid], msg
The name of the pool to which the message should be delivered. Supplying only this argument sends the message to all connections in the specified pool.
Sends the message to connections currently established to srv_name.
The OpenSwitch process ID of the client connection to receive the message. Connection spid numbers can be obtained using rp_who.
The text of the message to be delivered. This message must be less than 255 characters in length.
1> rp_msg POOL1, ase2, 19, "TEST" 2> go
Results:
Successfully queued message to spid 19 (return status = 0)
Due to the nature of TDS (the protocol used by clients to communicate with the OpenSwitch server), messages cannot be delivered immediately and, instead, are queued to be sent to clients during the next activity. All clients that were actively processing a result set at the time that rp_msg is issued receive the message at the very end of their result set, and all idle clients receive the message as soon as they initiate a new request of the server.
Idle clients that disconnect without issuing a subsequent query never receive the message.
Do not issue rp_msg from a client connection that is passing through OpenSwitch and using Adaptive Server to invoke the rp_msg RPC in OpenSwitch. This causes the issuing connection to be locked in a transaction, which means that the connection cannot be switched.
See the OpenSwitch error log (specified via the -l flag or LOG_FILE configuration option variable) for details:
rp_msg: Error while queuing message. See OpenSwitch error logs.
The spid supplied is not a valid spid in OpenSwitch:
rp_msg: spid is not a valid spid.
This may be because the spid has disconnected since the rp_msg request was issued.
The message has been queued to be delivered to the specified spid:
rp_msg: Successfully queued message to spid spid.
This message is displayed when the spid argument is -1:
rp_msg: Successfully queued message to N spids.
It indicates the total number of spids that have been scheduled to receive the message.
rp_who, sp_who